Re: Multi-assign

new topic     » goto parent     » topic index » view thread      » older message » newer message
Fernando said...

Some interesting possibilities with LHS symbolic sequences:

  • Initializing several variables with the same value:
{a,b,c} = 0

When the RHS is an atom, we might be able to get away with this, but once the RHS is a sequence, we strike ambiguities.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu