diff options
Diffstat (limited to 'schmaltz.scm')
-rwxr-xr-x | schmaltz.scm | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/schmaltz.scm b/schmaltz.scm index 940ff76..16236eb 100755 --- a/schmaltz.scm +++ b/schmaltz.scm | |||
@@ -24,21 +24,20 @@ schmaltz --- the command-line program | |||
24 | (else)) | 24 | (else)) |
25 | 25 | ||
26 | (define (main args) | 26 | (define (main args) |
27 | (define (display-render) | ||
28 | (display (render)) | ||
29 | (newline)) | ||
30 | (define (rout file) | 27 | (define (rout file) |
31 | (with-input-from-file file display-render)) | 28 | (with-input-from-file file (lambda () (render) (newline)))) |
32 | (cond | 29 | (cond |
33 | ((and (null? args) ; input from stdin | 30 | ((and (null? args) ; input from stdin |
34 | (char-ready?)) | 31 | (char-ready?)) |
35 | (display-render)) | 32 | (render) |
33 | (newline)) | ||
36 | ((member "-" args) | 34 | ((member "-" args) |
37 | (let-values (((fs1 fs2) | 35 | (let-values (((fs1 fs2) |
38 | (break (lambda (x) (equal? x "-")) | 36 | (break (lambda (x) (equal? x "-")) |
39 | args))) | 37 | args))) |
40 | (for-each rout fs1) | 38 | (for-each rout fs1) |
41 | (display-render) | 39 | (render) |
40 | (newline) | ||
42 | (for-each rout (cdr fs2)))) | 41 | (for-each rout (cdr fs2)))) |
43 | ((< 0 (length args)) | 42 | ((< 0 (length args)) |
44 | (for-each rout args)) | 43 | (for-each rout args)) |