On 5/10/06, <b class="gmail_sendername">Dan Shafer</b> &lt;<a href="mailto:dan@shafermedia.com">dan@shafermedia.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Well, your result is nothing like I ended up with; you found a much<br>more elegant solution (iterating over the exp for example). But note<br>that to create that code I'd have to know about the class String,<br>streams, collect: (a powerful but really new concept) and the
<br>raisedTo: method. Not hard stuff, of course, but, as you properly<br>say, it's a question of familiarity and only that.<br><br>In Basic, it's something like:<br><br>repeat with i = 1 to 10<br>&nbsp;&nbsp; print i; i*i, i*i*i<br>
end repeat</blockquote><div><br>You can pretty much write the same in Squeak too:<br><br>1 to: 10 do: [:i |<br>&nbsp;&nbsp;&nbsp; Transcript <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; show: i; tab;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; show: i * i; tab;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; show: i * i * i; cr]. <br></div>
<br>Actually, there's a squared method, but unfortunately, there's no cubed method ;-(<br><br>Also, it might be nice if Transcript <br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Essentially the same in Pascal. But note that the &quot;print&quot; statement<br>just prints stuff in a predictable place. When I solved the problem<br>in Smalltalk, I ended up believing that I needed to use the<br>Transcript for output, which involved figuring out how to get one to
<br>open and print stuff.</blockquote><div><br>I see what you're trying to get at, but unfortunately, this is not a particular good example, because It's the same in other languages too. <br><br>I don't know Pascal/Basic, but if you were to do it in Java, or C#, you'll end up using the StringBuilder class, which is just the equivalent to the Stream here. In C#, StringBuilder is part of 
System.Text, which requires a 'using' statement, so it's not a module that can be used out of the box either (and I'm sure the same is true in the Java case).<br><br>Duncan.</div></div>