Created
July 22, 2012 06:42
-
-
Save yamasushi/3158717 to your computer and use it in GitHub Desktop.
Gaucheマニュアルのcatサンプルを改造してみる。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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