diff options
Diffstat (limited to 'scsh-process.scm')
-rw-r--r-- | scsh-process.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scsh-process.scm b/scsh-process.scm index 63ce220..46a107a 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -43,6 +43,7 @@ ;; macros run/collecting run/string run/strings run/port run/file run/sexp run/sexps + || && (& maybe-symbol->string) (run maybe-symbol->string) (exec-epf maybe-symbol->string)) (import chicken scheme data-structures) @@ -151,6 +152,13 @@ (syntax-rules () ((_ ?epf ...) (run/sexps* (lambda () (exec-epf ?epf ...)))))) +(define-syntax && + (syntax-rules () + ((_ ?epf ...) (and (zero? (run ?epf)) ...)))) +(define-syntax || + (syntax-rules () + ((_ ?epf ...) (or (zero? (run ?epf)) ...)))) + (define-syntax & (syntax-rules () ((_ ?epf ...) @@ -233,7 +241,7 @@ (setup-redirection (= 1 (current-output-port))) (setup-redirection (= 2 (current-error-port))) ?expr0 ...)) - ((_ (epf ?args ...)) ; TODO: Figure out the point of this + ((_ (epf ?args ...)) ; This disambiguates redirection inside && and || (exec-epf ?args ...)) ;; This is purely for convenience, so you don't need the (epf ...) wrapper ((_ (?prog ?arg0 ...) ?redir0 ...) |