[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] Writing to a File
From: |
Isaac Gouy |
Subject: |
Re: [Help-smalltalk] Writing to a File |
Date: |
Sat, 22 Jan 2005 17:07:00 -0800 (PST) |
I have only a few moments, so go look at the examples at
http://shootout.alioth.debian.org/benchmark.php?test=all&lang=gst&sort=cpu
and try and get it to work with stdout rather than a file.
Then get it to work with a file.
Use variables
| foo bar |
instead of Smalltalk at:
-----------------------------------------------------------------------------
> Smalltalk at: #foo put: (SortedCollection new) !
> foo add: 'one' ; add: 'two' ; add: 'three' !
>
> Smalltalk at: #bar put: (FileDescriptor open: 'bug_output' mode:
> #write) !
> foo do: [:item| bar << item ; cr ; nl ] !
>
-----------------------------------------------------------------------------
>
> ...alas, it doesn't. I get a file with "onethreetwo" in it and that's
> it.
>
> I've tried variations as well, but no linefeeds or carriage returns,
> not even with "bar (nextPut: Character nl)".
>
> What am I doing wrong?
>
> --
> Stewart Stremler
>
>
> _______________________________________________
> help-smalltalk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-smalltalk
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
http://info.mail.yahoo.com/mail_250