[squeak-dev] History of #inject:into: and #do:separatedBy:

Louis LaBrunda Lou at Keystone-Software.com
Mon Jan 3 18:56:52 UTC 2011


Hi,

Does anyone know anything about the history of #inject:into: and/or
#do:separatedBy:?  I would like to know when they first appeared in
Smalltalk.  Were they present from the beginning?

I ask because I get into conversations with my two sons about the pros and
cons of programming languages.  My oldest son, knows (some) and likes
Smalltalk but programs in C++ and Java for Google.  My younger son is
learning Java.  I help him with some of his homework (I don't know Java but
I can still help) and when doing so, try to point out how things might be
done in Smalltalk.  Don't get me wrong, I want him to learn Java but would
also like to let him know that there are other languages out there.

I think #inject:into: and #do:separatedBy: are good examples of how things
can be added to Smalltalk after the syntax of the language has been defined
because Smalltalk has so little syntax (and because blocks of code are
objects).  I think adding something like these to Java would probably
require modifying the Java compiler and maybe the VM.

Another example might be #injectWithIndex:into:.  I don't know if a method
like that is all that valuable but if I needed it, I could add it without
much trouble.

Thanks in advance for anything anyone can tell me.

Lou
-----------------------------------------------------------
Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com




More information about the Squeak-dev mailing list