Skip to content
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

Draft
wants to merge 101 commits into
base: docs-restructure
Choose a base branch
from

Conversation

Demali-876
Copy link

This pull request covers primitives to shared types in the motoko documentation restructure.

Demali-876 and others added 30 commits February 4, 2025 20:25
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]>
Demali-876 and others added 21 commits February 18, 2025 20:54
Suggestion batch commit

Co-authored-by: Jessie Mongeon <[email protected]>
@Demali-876 Demali-876 requested a review from a team as a code owner February 26, 2025 21:08
Copy link
Contributor

mergify bot commented Feb 26, 2025

⚠️ The sha of the head commit of this PR conflicts with #4894. Mergify cannot evaluate rules on this PR. ⚠️

### Defining the traffic light state

```motoko norepl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```motoko norepl
```motoko no-repl

A function can define how the traffic light cycles from one state to the next.

```motoko norepl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```motoko norepl
```motoko no-repl

### Simulating traffic light changes

```motoko norepl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```motoko norepl
```motoko no-repl

#### Output

``` md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
``` md
```bash

Comment on lines 98 to 102

- A value of type `Nat`.
- Two child trees (`left` and `right`).
`#leaf` represents an empty node.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`#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.

@Demali-876 Demali-876 marked this pull request as draft February 27, 2025 21:24
| 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants