-
Notifications
You must be signed in to change notification settings - Fork 235
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 functions to change objects to be mutable and immutable #1092
Comments
Reasonable idea. Perhaps for symmetry the function could be called |
Hi, thanks for the new patch. Originally I was trying to do this I believe (now with
For the reason that I did not enjoy the idea passing a mutable array across my functions, however, I also wanted linked list essentially... |
Couldn't you just do |
Nice idea with the splice 👍 Perhaps though to emulate Thinking on it a bit more, if we don't know the details of
|
For my problem, this is a much better solution. And for the details of the
It's screaming linked-list isn't it :) And would the corresponding accessors looking like the following, if I were to use
|
Yup. |
Those seem like they could work, but...
Wouldn't using Not sure I'm following along well enough (^^; |
Thank you! |
Good point! Thanks sogaiu :) Edit: between this comment and the last, it did took around 5 mins in the repl to clear these out 😆 |
This would be effectively
transient
andpersistent!
in Clojure.persistent!
would befreeze
of Janet but with the deep freeze.For example, let's define them as
mutable
andfreeze
(shallow version).tuple and array
(mutable [1 2])
=@[1 2]
struct and dict
(mutable {1 2})
=@{1 2}
string and buffer ...
And
freeze
in the inverse operator ofmutable
This would also imply that
@
is made into a macro reader characterThe text was updated successfully, but these errors were encountered: