From d9f145e3e911c062631f522523818a2839798b6e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 28 Oct 2001 17:40:17 +0000 Subject: [PATCH] . original commit: 9794eeaffc54f47516c8f69cb1cd30ae432ab10d --- collects/mzlib/class.ss | 7 +++---- collects/mzlib/process.ss | 30 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/collects/mzlib/class.ss b/collects/mzlib/class.ss index 0660a61..70966d3 100644 --- a/collects/mzlib/class.ss +++ b/collects/mzlib/class.ss @@ -942,10 +942,9 @@ stx ids)]))) (with-syntax ([decl-form decl-form]) - (syntax - (begin - (decl-form name) - (define (name . ids) expr0 expr ...))))] + (with-syntax ([decl (syntax/loc stx (decl-form name))] + [defn (syntax/loc stx (define (name . ids) expr0 expr ...))]) + (syntax (begin decl defn))))] [(_ d . __) (or (identifier? (syntax d)) (and (stx-pair? (syntax d)) diff --git a/collects/mzlib/process.ss b/collects/mzlib/process.ss index 50a2b20..e87562c 100644 --- a/collects/mzlib/process.ss +++ b/collects/mzlib/process.ss @@ -11,17 +11,21 @@ ;; Helpers: ---------------------------------------- - (define (shell-path/args) + (define (shell-path/args who argstr) (case (system-type) - ((unix) '("/bin/sh" "-c")) - ((windows) (list - (let ([d (find-system-path 'sys-dir)]) - (let ([cmd (build-path d "cmd.exe")]) - (if (file-exists? cmd) - cmd - (build-path d "command.com")))) - "/c")) - (else (error "don't know what shell to use for ~e." (system-type))))) + ((unix) (append '("/bin/sh" "-c") argstr)) + ((windows) (let ([cmd + (let ([d (find-system-path 'sys-dir)]) + (let ([cmd (build-path d "cmd.exe")]) + (if (file-exists? cmd) + cmd + (build-path d "command.com"))))]) + (list cmd + 'exact + (format "~a /c ~a" cmd argstr)))) + (else (raise-mismatch-error + (format "~a: don't know what shell to use for platform: " who) + (system-type))))) (define (if-stream-out p) (if (or (not p) (file-stream-port? p)) @@ -86,13 +90,13 @@ control)))) (define (process/ports out in err str) - (apply process*/ports out in err (append (shell-path/args) (list str)))) + (apply process*/ports out in err (shell-path/args "process/ports" str))) (define (process* exe . args) (apply process*/ports #f #f #f exe args)) (define (process str) - (apply process* (append (shell-path/args) (list str)))) + (apply process* (shell-path/args "process" str))) ;; Note: these always use current ports (define (system* exe . args) @@ -128,4 +132,4 @@ (define (system str) (if (eq? (system-type) 'macos) (subprocess #f #f #f "by id" str) - (apply system* (append (shell-path/args) (list str)))))) + (apply system* (shell-path/args "system" str)))))