JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Thu Feb 28, 2008 1:42 pm Post subject: |
|
|
Wouldn't be particularly difficult to parse, but it wouldn't be a generic construct. That is, assigning multiple values into a single target doesn't mean anything for any type other than an object that defines opFieldAssign. And then, I'm not sure if it's worth taking up a syntactic construct for something so specific.
What you could do instead is give foo a "setBar" method that takes varargs and forwards them to opFieldAssign, such as:
Code: | foo.setBar = function(vararg) :opFieldAssign("bar", vararg)
foo.setBar(1, 2, 3) |
Not quite as pretty, but for how often this would probably be used, I'm not sure there's much of a need for a special syntax for it.
What Ligustah suggested would work too, although at the cost of creating a new array each time you executed that statement. |
|