FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

MiniD 2...
Goto page Previous  1, 2
 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Thu Feb 28, 2008 1:42 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group