Skip to content

Make Kernel#lambda always return a lambda #2262

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

Closed
wants to merge 1 commit into from

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Jul 2, 2019

Before this commit, when Kernel#lambda receives a Proc that is not a lambda,
it retuned it without modification. This commit makes it so that in all
cases, Kernel#lambda returns a Proc that is a lambda.

Calling a method called lambda and having it effectively do nothing was
not very intuitive.

Feature #15973
Bug #15620

@XrXr
Copy link
Member Author

XrXr commented Jul 2, 2019

This does two allocations when the input is a subclass of Proc. I did it this way because the code looks clearer to me this way. Let me know if you prefer eliding the allocation instead.

@XrXr XrXr force-pushed the consistent-lambda branch 2 times, most recently from 5f4d777 to 052acaf Compare July 2, 2019 13:25
Before this commit, when Kernel#lambda receives a Proc that is not a lambda,
it retuned it without modification. This commit makes it so that in all
cases, Kernel#lambda returns a Proc that is a lambda.

Calling a method called lambda and having it effectively do nothing was
not very intuitive.
@XrXr XrXr force-pushed the consistent-lambda branch from 052acaf to c03e55c Compare July 8, 2019 00:48
@k0kubun
Copy link
Member

k0kubun commented Aug 17, 2019

It seems to have a conflict now. Could you rebase this from master?

@XrXr
Copy link
Member Author

XrXr commented Aug 17, 2019

Thanks for the ping. Judging from the discussion about this proposal, I don't think this is going in. I'm also not sure if this is a good idea any more. I will close this for now and rebase this if the proposal gets accepted.

@XrXr XrXr closed this Aug 17, 2019
@XrXr XrXr deleted the consistent-lambda branch July 9, 2020 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy