Re: Multi-assign

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

$ is fine by me (or the underscore) to serve as a placemarker meaning "ignore me."

Insolor said...

I vote for underscore. In some languages there is the anonymous _ variable, which is used when the value doesn't matter.

In euphoria v4, an underscore, by itself is actually a valid variable name.

euphoric said...

What about the case where there are not enough RHS items to complete LHS requests? Or vice versa?

{ a } = { 1, 2, 3 } 
 
{ a, b, c } = { 1 } 

In the first case, 1 is assigned to a, and the rest of the sequence is ignored. In the second case, you get a subscript error.

Matt

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

Search



Quick Links

User menu

Not signed in.

Misc Menu