-
Notifications
You must be signed in to change notification settings - Fork 16
Need to use .set and .get #12
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
Comments
The problem is that a normal (I don't see any mention of For example, take the example of a vector.
Now, of course, it should be possible to easily read values:
But you can't use assignment to update the vector:
This is because, by definition, these data structures are immutable.
This is actually the same way that strings work in Javascript:
The only way to assignment work reliably would be to create a new value on every assignment. This can technically work, but seems to be complicated and confusing for Javascript. |
Actually I apologize I wrote this late before I forgot about it but I don't think set is as important, just being able to get without explicit |
@natew I agree with the subscript based get. But It would only work for vectors and records, as Maps take non-string, non-number strings as well. |
As much as I'd like to be able to do avoid using Index and property access without get/set can always be added at a later stage. |
I agree that |
I don't see anywhere in docs but I'd like to treat my immutable data structures like normal JS ones, in that I dislike having to use
get
andset
rather than just=
. I assumed this spec would have something along those lines but I didn't see it explicitly.The text was updated successfully, but these errors were encountered: