Hi, Here's a simple example: https://github.com/slavapestov/factor/blob/master/extra/tzinfo/tzinfo.factor
It uses with-file-reader ( http://docs.factorcode.org/content/word-with-file-reader,io.files.html ) to bind the file stream to the default input stream. It then calls read and its variants and when the whole file is parsed stores the result in an object. Regards, Jon Jon On Tue, Sep 1, 2015 at 12:31 PM, HP Wei <hpwe...@gmail.com> wrote: > I am just starting to learn factor. > > In ocaml or python, when I open a file stream, I usually set up an object > with an accumulator class variable where I collect the selected info while > walking through the stream (file). > > I am trying to look at various places to find an equivalent way of doing > this > [ or the natural way (folding?) of achieving the goal ] in factor. > Could you please help me out ? > > thanks > HP > > > > ------------------------------------------------------------------------------ > _______________________________________________ > Factor-talk mailing list > Factor-talk@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/factor-talk >
------------------------------------------------------------------------------
_______________________________________________ Factor-talk mailing list Factor-talk@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/factor-talk