History of #inject:into: and #do:separatedBy:

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

History of #inject:into: and #do:separatedBy:

Postby PhotonDemon » Mon Jan 03, 2011 10:54 am


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.

Louis LaBrunda
Keystone Software Corp.
SkypeMe callto://PhotonDemon
mailto:Lou@Keystone-Software.com http://www.Keystone-Software.com
Posts: 176
Joined: Thu Dec 20, 2007 1:45 pm

Re: History of #inject:into: and #do:separatedBy:

Postby TriSebastian » Tue Jan 04, 2011 8:50 am


Have a look at the second part of this post:

http://talklikeaduck.denhaven2.com/2010 ... -into-ruby

Posts: 76
Joined: Sun Jul 20, 2008 9:40 pm
Location: Nanaimo, BC, Canada

Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Google [Bot] and 1 guest