Chris,

On Tue, Mar 16, 2010 at 3:12 PM, Chris Cunnington
<[email protected]> wrote:
> But it seems to be blind spot in my Smalltalk knowledge. I keep trying:
>
> x := 0.
> (x < 10) whileTrue: [Transcript show: x.  x := x + 1]

with [x<10] instead of (x<10), this works perfectly for me, printing 0123456789.

> (1 to: 10) do: [: x | Transcript show: x.]

And this works out of the box.

(Squeak, trunk.)

> I don't see how to iterate the variable and then print it. It's as thought a
> value changed in a block wouldn't get fed back into that block.

I'm afraid I don't see the problem.

Best,

Michael
_______________________________________________
Beginners mailing list
[email protected]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

Reply via email to