ActionScript:
for each(var anObject: AClass in aCollection)
{
anObject.DoSomething
}
Smalltalk:
aCollection do [:anObject | anObject doSomething].
While not severely different, Smalltalk has the purity of the entire statement being composed of objects and messages. The dynamic typing eliminates the need for the AClass reference, which has ramifications that are too complex to cover right now. Though I think the ":anObject" is a syntactical construct, not an actual message to the block--it sure looks like it though, doesn't it?
Thursday, January 1, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment