Re: Multi-assign
- Posted by mattlewis (admin) Nov 16, 2011
- 2614 views
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