What the hell does write-line do?

I used this script:

#! /usr/local/bin/csi -s

(define (write-line* line)
  (display line)
  (newline))

(if (not (null? (command-line-arguments)))
    (set! write-line write-line*))

(let next-line ((line (read-line)))
  (if (not (eof-object? line))
      (begin
        (write-line line)
        (next-line (read-line)))))

The build in write-line:

$ dd if=/dev/zero bs=1M count=100 | od -xv | cat.scm > /dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 18.7047 s, 5.6 MB/s

The self written version:

$ dd if=/dev/zero bs=1M count=100 | od -xv | cat.scm 1 > /dev/null
100+0 records in
100+0 records out
104857600 bytes (105 MB) copied, 13.3583 s, 7.8 MB/s

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to