[ create a new paste ] login | about

Project: programmingpraxis
Link: http://programmingpraxis.codepad.org/HS4bHJFl    [ raw code | fork ]

programmingpraxis - Scheme, pasted on Jun 6:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /usr/bin/scheme --script

(define (do-file file-name)
  (let ((p (if (string=? file-name "-")
               (current-input-port)
               (open-input-file file-name))))
    (do ((c (read-char p) (read-char p)))
        ((eof-object? c))
      (display c))
    (close-input-port p)))

(let ((args (if (and (pair? (cdr (command-line)))
                     (string=? (cadr (command-line)) "-u"))
                (cddr (command-line))
                (cdr (command-line)))))
  (if (null? args)
      (do-file "-")
      (do ((args args (cdr args)))
          ((null? args))
        (do-file (car args)))))


Create a new paste based on this one


Comments: