[PRL] Re: [plt-internal] Fwd: Load Balancing for networks

William D Clinger will at ccs.neu.edu
Tue Jan 13 14:01:45 EST 2004


I'll put my fifty cents on some variation of this:

    (define (parse-file fn)
      (call-with-input-file
       fn
       (lambda (p)
         (let ((charlist (read-characters-from-port p)))
           (let loop ((charlist charlist))
             (if (positive? (length charlist))
                 ...
                 ...))))))

Matthias knows my story about the professional who did this in
MacScheme, and then complained because MacScheme took over two
hours to parse a file that his C code was parsing in just a few
seconds.

Another possibility is the use of STRING-APPEND to concatenate
lines of input.

Will


More information about the PRL mailing list