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

Add a tutorial about arrays #1405

Merged
merged 24 commits into from Aug 23, 2023
Merged

Add a tutorial about arrays #1405

merged 24 commits into from Aug 23, 2023

Conversation

gpetiot
Copy link
Contributor

@gpetiot gpetiot commented Jul 18, 2023

I didn't meddle with the order of tutorials (I would place it after the List tutorial). Currently it relies on the alphabetical order of the file names, it would be nice to modify that order without renaming files, in the template directly maybe?

@sabine
Copy link
Collaborator

sabine commented Jul 19, 2023

Do go ahead and rename the files to have the proper order.

It's more obvious when the order in the directory maps directly to the order on the page, rather than doing another sorting step in the template/handler.

@gpetiot
Copy link
Contributor Author

gpetiot commented Jul 19, 2023

I've renamed the files.

@tmattio tmattio linked an issue Jul 19, 2023 that may be closed by this pull request
@cuihtlauac
Copy link
Collaborator

This branch: https://github.com/ocaml/ocaml.org/tree/array-tutorial has an additional review & update commit. Not sure if the issue comes from me or GH, but I can't push here directly.

@gpetiot
Copy link
Contributor Author

gpetiot commented Jul 21, 2023

I've cherry-picked your commit, thanks for the review!

@cuihtlauac
Copy link
Collaborator

There's another one in the same branch ontop of the first

sabine added a commit that referenced this pull request Jul 24, 2023
sabine added a commit that referenced this pull request Jul 24, 2023
sabine added a commit that referenced this pull request Jul 24, 2023
@sabine sabine force-pushed the array-tutorial branch 2 times, most recently from 4ccb8cb to 728cb0f Compare July 24, 2023 15:57
sabine added a commit that referenced this pull request Jul 24, 2023
sabine added a commit that referenced this pull request Jul 24, 2023
Co-authored-by: Simmo Saan <simmo.saan@gmail.com>
Copy link
Collaborator

@christinerose christinerose left a comment

Choose a reason for hiding this comment

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

Mostly minor grammar / syntax stuff, but I did suggest a change in two code blocks -- to included the prompt for clarity.

data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved
data/tutorials/language/1ds_01_arrays.md Outdated Show resolved Hide resolved

In OCaml, arrays are collections of elements of the same type that are stored in contiguous memory locations. They are mutable, each value can be updated, but they have a fixed size; which set them apart from lists.

Despite these differences many of the functions readily available on arrays are similar to the ones available for lists, please refer to the [List tutorial](https://ocaml.org/docs/lists) and documentation for more details about these functions.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be helpful to mention some example before urging new users/readers back to the List tutorial.

Despite these differences, many of the functions readily available on arrays are similar to the ones available for lists such as X, Y, and Z. Please refer to the List tutorial and documentation for more details about these functions.

gpetiot and others added 16 commits July 31, 2023 14:03
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
Co-authored-by: Christine Rose <christinerose@users.noreply.github.com>
Co-authored-by: tuohy <g.tuohy@outlook.com>
sabine added a commit that referenced this pull request Aug 3, 2023
@sabine
Copy link
Collaborator

sabine commented Aug 22, 2023

@sabine sabine merged commit 9675e85 into ocaml:main Aug 23, 2023
3 checks passed
@gpetiot gpetiot deleted the array-tutorial branch August 23, 2023 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Arrays
8 participants