Skip to content

Splatting an lvalue without enough corresponding rvalues  #129

@kedarmhaswade

Description

@kedarmhaswade

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=[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions