On 5/10/06, Dan Shafer <dan@shafermedia.com> wrote:
Well, your result is nothing like I ended up with; you found a much
more elegant solution (iterating over the exp for example). But note
that to create that code I'd have to know about the class String,
streams, collect: (a powerful but really new concept) and the
raisedTo: method. Not hard stuff, of course, but, as you properly
say, it's a question of familiarity and only that.
In Basic, it's something like:
repeat with i = 1 to 10
print i; i*i, i*i*i
end repeat
Essentially the same in Pascal. But note that the "print" statement
just prints stuff in a predictable place. When I solved the problem
in Smalltalk, I ended up believing that I needed to use the
Transcript for output, which involved figuring out how to get one to
open and print stuff.