Skip to content
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

Splatting an lvalue without enough corresponding rvalues #129

Open
kedarmhaswade opened this issue Mar 29, 2011 · 0 comments
Open

Splatting an lvalue without enough corresponding rvalues #129

kedarmhaswade opened this issue Mar 29, 2011 · 0 comments

Comments

@kedarmhaswade
Copy link

First off, excellent discussion on splat operator at: http://ruby.runpaint.org/variables#splat-lvalue

Perhaps, that section could clarify that when an lvalue is splatted and it does not have enough corresponding rvalues, it is assigned an empty array and not nil. For example,

a, b = 1 #=> a=1, b=nil
whereas,
a,*b=1 #=> a=1, b=[]

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

No branches or pull requests

1 participant