[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: why Lispworks' file i/o way slower than Clisp?

William James

10/15/2015 5:40:00 AM

corps wrote:

> (defun count-line ()
> (with-open-file (in "E:/test.txt")
> (loop for line = (read-line in nil nil) with total = 0 while line
> do (incf total) finally (print total))))

Gauche Scheme:

(define (count-lines)
(with-input-from-file "tmp.txt"
(lambda ()
(generator-fold (lambda (line cnt) (+ 1 cnt)) 0 read-line))))

--
Man is a social animal just like ants or bees or wolves. All have their living
space, which they defend to the very end. ---
http://www.kolumbus.fi/aquilon/aquilon...