-
Notifications
You must be signed in to change notification settings - Fork 232
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
added thaw to complement freeze #1142
Conversation
(Sorry my original comment was confused / wrong -- hopefully this latest version is better.) May be prototype stuff is not being handled: (def ds
(struct/with-proto {:b 2} :a 1))
(get ds :a)
# =>
1
(get ds :b)
# =>
2
(get (thaw ds) :a)
# =>
1
(get (thaw ds) :b)
# =>
nil
|
Interesting, I'll look into it. Thanks! |
OK, prototypes don't appear in normal lookups, I guess I could check recursively for prototypes in structs and maps and inline them with the uppermost struct. Not sure about the performance implications of that approach, but I'll implement it quickly. |
Oh nevermind, I can just use proto-flatten |
Ok, should be fixed now |
Worked here too 👍 Will you be adding any tests? |
Minor comment: maybe handle the different types in the same order as |
I added simple tests for thaw and freeze and reordered the types in the implementation |
On a side note, going over the tests I started to wonder whether it would be worth having functions like I didn't see any functions like that already, but I don't know if they'd be that useful. |
Relevant issue: #1092
Not sure if all cases are handled here.