I'm porting some code I prototyped in python over to flash and while actionscript doesn't suck quite as bad as I expected (I hear v3 is quite a lot better than v2!) there's still some stuff I'm having to do that seems overly prosaic / boilerplate e.g. summing a list...
var a:int = 0;
for each ( var value:int in annual_saving )
{
a = a + value;
}
return a / 100;
as opposed to...
return reduce(lambda x,y: (x+y), self.annual_saving ) / 100
That feels a bit too much like Java for me (eww Java: puke! X-O###)
Am I simply ignorant of as3's cool array summing function? Or does it understand lambda calculus, or do list comprehensions? or provide some other such concise notation? Am I right in suspecting there is a more elegant way of doing this or am I stuck in the 20th century for the remainder of this project!?
Cheers :)
Roger.