-
-
Notifications
You must be signed in to change notification settings - Fork 373
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
Request to undeprecate Pair .freeze #5121
Comments
The reason for If we're going to re-instate this behaviour, I'd rather see it as a sub-class of |
I was about to say "shouldn't it just return |
|
Yall were faster than me. Still, I'm gonna leave this here. |
Nope, |
I think most of the hassle comes from the misdesign and/or miscommunication of what a Pair is and what it's meant for. Confer the smartmatching behavior as well. Pair is, or at least was, no matter how funny this sounds, really an alias for a symbol, and therefore a value-typed key with any value or container bound to it. I really doubt the name or the semantics of Pair could change in the foreseeable future but we should at least try to communicate it clearly what it is and what it is not:
One place where this education can take place is the documentation. It's good that there is an entry about an essential aspect of Pair behavior - however, rather ironically it advises the use of For |
works for me, something like
|
Hi there! Asker of the SO question linked in the title here. I have definitely learned a lot from reading this. It was not at all clear to me from the docs alone that In my mind, it's a bit of a shame that a generic word like Even in the absence of a significant name change, I think there does need to be a separate type. It seems I'm not the only one using And if there were two separate types, then some of the other misleading things can be moved over too. For instance, |
The Problem
Certain algorithms are easier to understand and maintain with the Pair
.freeze
method.This is evident from a recent StackOverflow question.
Expected Behavior
My vote is to keep
.freeze
in the language (perhaps with another name)Actual Behavior
.freeze
is deprecated and scheduled for removal.Environment
any
The text was updated successfully, but these errors were encountered: