That's exactly what I was trying to do - thanks!

On Wed, Jul 19, 2017 at 12:26 PM, Greg Hendershott <
greghendersh...@gmail.com> wrote:

> If you frequently want to deal with files as a list of lines, you
> could wrap the code Ben showed you in a function:
>
> (define (file->lines file)
>   (with-input-from-file file
>     (λ ()
>       (for/list ([line (in-lines)])
>         line))))
>
> As it happens, Racket already defines this function for you:
>
>   https://docs.racket-lang.org/reference/Filesystem.html#%
> 28def._%28%28lib._racket%2Ffile..rkt%29._file-~3elines%29%29
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to