Hmmm, I was working with:
"/path/to/bigfile" ascii [ [ ... ] each-line ] with-file-reader But I want to work with a binary data... is ascii 'safe' enough for that? Binary encoding doesn't work with readln. On Thu, Jan 15, 2009 at 11:14 AM, Samuel Tardieu <[email protected]> wrote: >>>>>> "Adam" == Adam <[email protected]> writes: > > Adam> Is there a feature in Factor that acts like Generators in > Adam> Python? I.E. adding an iteration protocol where a result is > Adam> computed, returned, and then yeilds to the caller? > > You can also use lazy lists (in "lists.lazy"). For an example, you can > look at "math.primes.lists", where "lprimes" is an infinite stream > containing all the prime numbers: > > USE: math.primes.lists > 100000 lprimes lnth > ===> 1299721 > > "lprimes" is defined as its first element and a word to get from the > current element to the next one: > > : lprimes ( -- list ) 2 [ next-prime ] lfrom-by ; > > Sam > -- > Samuel Tardieu -- [email protected] -- http://www.rfc1149.net/ > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > SourcForge Community > SourceForge wants to tell your story. > http://p.sf.net/sfu/sf-spreadtheword > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk > ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
