Re: Multi-assign

new topic     » goto parent     » topic index » view thread      » older message » newer message
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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu