Re: Multi-assign
- Posted by petelomax Nov 19, 2011
- 2168 views
DerekParnell said...
Consider ...
{a,b,c} = 1 -- Assign 1 to a, b, and c {a,b,c} = {d,e,f} -- Assign {d,e,f} to a, b, and c or -- assign d to a, e to b, and f to c?
My take on this was:
{a,b,c} = 1 -- illegal/error {a,b,c} @= 1 -- a=1, b=1, c=1 {a,b,c} = {d,e,f} -- a=d, b=e, c=f {a,b,c} @= {d,e,f} -- a={d,e,f}, b={d,e,f}, c={d,e,f}
Pete