-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs Restructure: Covering primitives to shared types #4923
base: docs-restructure
Are you sure you want to change the base?
Docs Restructure: Covering primitives to shared types #4923
Conversation
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Remove control flow
Suggestion batch commit Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
|
### Defining the traffic light state | ||
|
||
```motoko norepl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```motoko norepl | |
```motoko no-repl |
A function can define how the traffic light cycles from one state to the next. | ||
|
||
```motoko norepl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```motoko norepl | |
```motoko no-repl |
### Simulating traffic light changes | ||
|
||
```motoko norepl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```motoko norepl | |
```motoko no-repl |
#### Output | ||
|
||
``` md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` md | |
```bash |
|
||
- A value of type `Nat`. | ||
- Two child trees (`left` and `right`). | ||
`#leaf` represents an empty node. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`#node` contains: | |
- A value of type `Nat`. | |
- Two child trees (`left` and `right`). | |
`#leaf` represents an empty node. | |
1. `#node` contains: | |
- A value of type `Nat`. | |
- Two child trees (`left` and `right`). | |
2. `#leaf` represents an empty node. |
Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Jessie Mongeon <[email protected]>
| Use case | When data should remain unchanged | When frequent modifications are needed | | ||
|
||
Motoko arrays, both mutable and immutable, are not designed to grow dynamically. If a dynamically growing contiguous data structure is required, `Buffer` should be used instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Motoko arrays, both mutable and immutable, are not designed to grow dynamically. If a dynamically growing contiguous data structure is required, `Buffer` should be used instead. | |
Unlike other programming languages that support append methods for arrays, Motoko arrays, both mutable and immutable, are not designed to grow dynamically. Motoko arrays cannot be appended. If a dynamically growing contiguous data structure is required, `Buffer` should be used instead. |
This pull request covers primitives to shared types in the motoko documentation restructure.