Multi-assign
- Posted by mattlewis (admin) Nov 15, 2011
- 2762 views
For 4.1, I started working on multiple assignment. Basically, it would look like this:
{ x, y } = { 1, "foo" } { $, x } = value( y )
It's really syntactic sugar, but can make some code a lot easier to read. My implementation currently uses dollar signs to ignore values. There's been some concern on the dev list that this might be confusing, so I'd like to get feedback from the wider community.
Does a dollar make sense? Should we use a different symbol? Should we just put extra commas in?
For those interested, the code is currently in the 'multi-assign' branch in the Mercurial repo.
Matt