This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
re: help to get this running faster
- To: guile-user at gnu dot org
- Subject: re: help to get this running faster
- From: Brad Knotwell <knotwell at ix dot netcom dot com>
- Date: Sat, 2 Sep 2000 20:52:23 -0700 (PDT)
- List-Id: <guile-user.gnu.org>
Hello--
It's not exactly the same script, but I think it does pretty much the same
thing (I changed from a set of nested lists (???) to a single list).
On my machine, it's an order of magnitude faster than the previous
script.
--Brad
(define-module (alto tabreader))
(export load-records)
(use-modules (ice-9 optargs))
(use-modules (ice-9 string-fun)
(define* (load-records fname #&optional (sep #\tab))
(call-with-input-file fname
(lambda (i-stream)
(do ((records '())
(line (read-line i-stream) (read-line i-stream)))
((eof-object? line) records)
(set! records (append records (list (split-discarding-char sep line list))))))))
;; (load-records "/tmp/h")
_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user