Re: [racket] read text file

2010-12-07 Thread Matthias Felleisen
On Dec 6, 2010, at 11:35 PM, Eli Barzilay wrote: > Three minutes ago, prad wrote: >> On Mon, 6 Dec 2010 19:48:14 -0700 >> Jay McCarthy >> wrote: >> >>> Try file->string >>> >> thx jay and sam! >> file->string works very nicely for what i'm doing, but i'll check the >> read-all out later. inte

Re: [racket] read text file

2010-12-06 Thread Eli Barzilay
Three minutes ago, prad wrote: > On Mon, 6 Dec 2010 19:48:14 -0700 > Jay McCarthy > wrote: > > > Try file->string > > > thx jay and sam! > file->string works very nicely for what i'm doing, but i'll check the > read-all out later. interesting that now i have so many options! :D Just to give you

Re: [racket] read text file

2010-12-06 Thread prad
On Mon, 6 Dec 2010 19:48:14 -0700 Jay McCarthy wrote: > Try file->string > thx jay and sam! file->string works very nicely for what i'm doing, but i'll check the read-all out later. interesting that now i have so many options! :D -- In friendship, prad ...

Re: [racket] read text file

2010-12-06 Thread Sam Phillips
On Mon, Dec 6, 2010 at 6:52 PM, Sam Phillips wrote: > On Mon, Dec 6, 2010 at 6:43 PM, prad wrote: >> but what am i supposed to in racket? >> (other than read-line right through to the end of the file, may be?) > > In unstable/port there is read-all.  Which you could use like > > (list->string (re

Re: [racket] read text file

2010-12-06 Thread Sam Phillips
On Mon, Dec 6, 2010 at 6:43 PM, prad wrote: > but what am i supposed to in racket? > (other than read-line right through to the end of the file, may be?) In unstable/port there is read-all. Which you could use like (list->string (read-all read-char port)) Cheers, Sam __

Re: [racket] read text file

2010-12-06 Thread Jay McCarthy
Try file->string Jay On Mon, Dec 6, 2010 at 7:43 PM, prad wrote: > i'm trying to read a text file into a string, sort of like > > readFile path -- in haskell > or > handle = open(path, 'r'); data = handle.read() # in python > > however, in the guide > open-input-file > call-with-input-file > al

[racket] read text file

2010-12-06 Thread prad
i'm trying to read a text file into a string, sort of like readFile path -- in haskell or handle = open(path, 'r'); data = handle.read() # in python however, in the guide open-input-file call-with-input-file all use read-line in lisp i could get the length of the stream and slurp the whole fil