Sure there is a #do:.
It's executing, just not printing. The @ is cool
but I prefer not to use it unless I have to. Too much like perl or
ruby.
Here is #do:
> zz:={1,2,3}
> xx:=0
> zz do: [:yy | xx:=xx+yy]
> zz do: [:yy | xx:=xx+yy]
error: an instance of Number does not respond to "do:"
I cant imagine a smalltalk with a #do: message. try this
xx:=0. {1,2,3} do: [:yy | xx:=xx+yy]. xx.
Hopefully you will see a 6.
The log works and so also printString outputs to the workspace
correctly. It's the iteration that doesnt print.
Three globals, stdin, stdout and stderr, give access to the standard IO streams. stdout and stderr provide a method for outputing a string: -(void) print:(NSString *)string. For example:
stdout print:'hello world'
You should use it instead of the log: method provided by the sys object, as the sys object is not available when developing F-Script classes.
On Sat, Sep 5, 2009 at 1:07 PM, WyattBiker <wyatt...@gmail.com> wrote:
I cant imagine a smalltalk with a #do: message. try this
xx:=0. {1,2,3} do: [:yy | xx:=xx+yy]. xx.