diff options
author | Peter Bex <peter@more-magic.net> | 2012-10-01 17:20:20 +0100 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2012-10-01 17:20:20 +0100 |
commit | 11db27b4994ddcc1073ceb2b69b73601e29ed164 (patch) | |
tree | 342a30a3b38d86d579eb9d5e376d29094b6408bf /scsh-process.scm | |
parent | 9a9895123961e426afbaf33b6662f190f58f0dd7 (diff) | |
download | scsh-process-11db27b4994ddcc1073ceb2b69b73601e29ed164.tar.gz |
Fix nested pipe expressions and run/sexps, adding tests for both
Diffstat (limited to 'scsh-process.scm')
-rw-r--r-- | scsh-process.scm | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/scsh-process.scm b/scsh-process.scm index 9d92ac1..7d33f73 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -93,7 +93,7 @@ (define (run/sexp* thunk) (read (run/port* thunk))) (define (run/sexps* thunk) - (read-all (run/port* thunk))) + (read-file (run/port* thunk))) ;;;;;;;;;;;; ;; Syntax ;; @@ -194,27 +194,21 @@ ((_ ((?from0 ?from1 ___ ?to) ___) ?pf0 ___ ?last-pf) (let ((conns `((?from0 ?from1 ___ ?to) ___))) (setup-redirection ?redir0) ... - (begin (fork/pipe+ conns (lambda () (exec-epf (epf ?pf0)))) - ___ - (exec-epf (epf ?last-pf)))))))) + (begin (fork/pipe+ conns (lambda () (exec-epf (epf ?pf0)))) + ___ + (exec-epf (epf ?last-pf)))))))) (pipe+ ?args ...))) ((_ (begin ?expr0 ...)) (begin (setup-redirection (= 0 (current-input-port))) (setup-redirection (= 1 (current-output-port))) (setup-redirection (= 2 (current-error-port))) ?expr0 ...)) - ;; epf can be used if you happen to have a program called - ;; "epf", "begin", "pipe", etc which you'd like to run. - ((_ (epf ?args ...)) - (let-syntax ((exec-epf - (syntax-rules ___ () - ((_ (?prog ?arg0 ___) ?redir0 ___) - (begin - (setup-redirection ?redir0) ___ - (exec-path `?prog `?arg0 ___)))))) - (exec-epf ?args ...))) + ((_ (epf ?args ...)) ; TODO: Figure out the point of this + (exec-epf ?args ...)) ;; This is purely for convenience, so you don't need the (epf ...) wrapper ((_ (?prog ?arg0 ...) ?redir0 ...) - (exec-epf (epf (?prog ?arg0 ...) ?redir0 ...))))) + (begin + (setup-redirection ?redir0) ... + (exec-path `?prog `?arg0 ...))))) )
\ No newline at end of file |