Programming language shootout: sum file
From Gambit wiki
I have no idea what the real data is supposed to be.
#!gsi-script ;; The Computer Language Benchmarks Game ;; http://shootout.alioth.debian.org/ ;; ;; Derived by Bradley Lucier from the Ikarus variant ;; derived by Michael D. Adams from the MzScheme variant (declare (standard-bindings)(extended-bindings)(block)(not safe)) (define (main) (time (let ([in (current-input-port)]) (let loop ([acc 0]) (let ([n (read-line in)]) (if (eof-object? n) (begin (display acc) (newline)) (loop (+ acc (string->number n)))))))))
gsi sum-file < sum-file.in