Skip to content

Is assignment of array elements with let not supported? #1283

Discussion options

You must be logged in to vote

Basically, the \ notation is for paths.

  • x\y is a :path value, meaning get the Y key (which is a value!) from X
  • the equivalent as a setter would be a :pathLabel, e.g. x\y: ... set the Y key of X to whatever is on the right-hand side.

Now, a few asterisks:

  • the left-most part of a path must be a normal id (= :word). In the above case, it's x (which is fine). In you example, this 'a is a literal, and paths don't work with literals (yet?)
  • now, regarding the path items that follow: these are values. The values themselves. ⚠️ So, if you want to get e.g. the Nth element of an array, you would actually have to specify that you want the element at the index of N value... (in a few words, we'd ha…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@programandala-net
Comment options

Answer selected by programandala-net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants