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

"Accessing and updating vectors" using with should be expanded #604

Open
ThinkOpenly opened this issue Jun 24, 2024 · 1 comment
Open

"Accessing and updating vectors" using with should be expanded #604

ThinkOpenly opened this issue Jun 24, 2024 · 1 comment
Assignees

Comments

@ThinkOpenly
Copy link
Contributor

The section "Accessing and updating vectors" includes:

A vector v can have an index index using [v with index = expression]. Similarly, a sub-range of v can be updated using [v with n .. m = expression] [...]

Note "index index". I presume that inadvertent.

Also, this could benefit some further explanation and examples.

Does the expression [x with 1 = 2] create a new array with the same size and type as x, but with the value at index 1 set to 2?

It's not clear what these expressions using with do, or how to best use them.

@Alasdair
Copy link
Collaborator

Does the expression [x with 1 = 2] create a new array with the same size and type as x, but with the value at index 1 set to 2?

Yes, exactly this

@Alasdair Alasdair self-assigned this Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants