On Fri, Nov 21, 2008 at 12:32 AM, Chris Double
<[EMAIL PROTECTED]> wrote:
> On Fri, Nov 21, 2008 at 7:26 PM, Slava Pestov <[EMAIL PROTECTED]> wrote:
>> An easier way to do the above,
>
> With the caveat that the first solution will print a 10,000,000 line
> file, but the second will fail.
Here is another solution then:
: t1a ( -- )
"c:/factor/work/t1/test.txt" utf8 [
[ readln dup ] [ print ] [ drop ] while
] with-input-stream ;
The docs for stream-readln say
``Most code only works on one stream at a time and should instead use
readln; see Default input and output streams.''
Slava
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk