Skip to content

Instantly share code, notes, and snippets.

@yamasushi
Created July 22, 2012 06:42
Show Gist options
  • Save yamasushi/3158717 to your computer and use it in GitHub Desktop.
Save yamasushi/3158717 to your computer and use it in GitHub Desktop.
Gaucheマニュアルのcatサンプルを改造してみる。
#!/usr/bin/env gosh
(define (open-with-input-files files proc)
(if (null? files)
(proc (current-input-port) )
(for-each
(lambda (f)
(call-with-input-file f proc))
files)))
(define (main args) ;entry point
(open-with-input-files
(cdr args)
(cute copy-port <> (current-output-port))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment