Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.lisp
Re: beginner question on input from large files
William James
5/23/2015 6:41:00 AM
Erik Naggum wrote:
> if you're not as silly as to have an allergic reaction to LOOP, this is
> even better:
>
> (defun stream-lines (input-stream)
> (loop for line = (read-line input-stream nil :eof)
> until (eq line :eof)
> collect line))
Gauche Scheme:
(use srfi-42 :only (list-ec))
(define (port-lines input-port)
(list-ec (:port line input-port read-line) line))
Another way:
(define (port-lines input-port)
(generator-map identity (cut read-line input-port)))
The easiest way:
(port->string-list port)
--
This is war, and our greatest enemy is the enemy within: the submissive,
apologetic, guilt-ridden, self-hating drone. The moment we manage to destroy
the enemy within, destroying the rest of our enemies will be a walk in the
park.
http://www.kolumbus.fi/aquilon/londonsp...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: beginner question on input from large files
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password