-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Feature request: tuple expansion in blocks #1415
Comments
Hi, The issue in github is this one Feel free to +1 it ;-) On Tue, Sep 8, 2015 at 10:07 AM, Colin Marc notifications@github.com
Brian J. Cardiff - Manas Technology Solutions |
Closing as a duplicate. |
Cool, I will +1 that one =). FWIW, though, that's not exactly the same as what I'm describing - this would work without splatting anything (as it does in ruby). |
Well, we're pretty aware of autosplat and the lack thereof, just undecided on whether to do that or explicit destructing (#132) ;) |
Ah, that's much more what I was getting at. Thanks for the link! =) |
Sorry if this has already been brought up somewhere.
In ruby, all of the following three snippets of code produce the same output:
Crystal, however, is missing some functionality. The first and third work, but not the second; and the first works only because there's a separate implementation for
each_cons
(andeach_with_index
,Hash#each
, etc) in order toyield
two values.I'm not sure what exactly the right solution is; but since we automatically compact multiple yield values, as in the third example above, I think it would be a reasonable feature to automatically expand them to the right arity, as well.
The text was updated successfully, but these errors were encountered: