mzscheme -> scheme

svn: r16240
This commit is contained in:
Eli Barzilay 2009-10-05 04:36:22 +00:00
parent b0e8fac1f8
commit e499c32435

View File

@ -8,7 +8,7 @@
;; running MzScheme.exe on Windows -- "winvers.ss" uses a trick of making a ;; running MzScheme.exe on Windows -- "winvers.ss" uses a trick of making a
;; copy of the binary and restarting that copy for the actual change. ;; copy of the binary and restarting that copy for the actual change.
(module winvers-change mzscheme #lang scheme
(define verbose? #t) (define verbose? #t)
(define binary-extensions '("exe" "dll" "lib" "so" "def" "exp" #|"obj" "o"|#)) (define binary-extensions '("exe" "dll" "lib" "so" "def" "exp" #|"obj" "o"|#))
@ -51,7 +51,7 @@
"Warning: ~a was not renamed!\n" (full-path))])) "Warning: ~a was not renamed!\n" (full-path))]))
(let-values ([(i o) (open-input-output-file file 'update)]) (let-values ([(i o) (open-input-output-file file 'update)])
(define print? verbose?) (define print? verbose?)
(for-each (lambda (subst) (for ([subst (in-list substitutions)])
(file-position i 0) (file-position i 0)
(let loop ([pos 0]) (let loop ([pos 0])
(cond [(regexp-match-positions subst i) => (cond [(regexp-match-positions subst i) =>
@ -64,7 +64,6 @@
(flush-output o) (flush-output o)
(file-position i (+ pos (cdar m))) (file-position i (+ pos (cdar m)))
(loop (+ pos (cdar m))))]))) (loop (+ pos (cdar m))))])))
substitutions)
(file-position i 0) (file-position i 0)
(when (regexp-match-positions xxxs i) (when (regexp-match-positions xxxs i)
(fprintf (current-error-port) (fprintf (current-error-port)
@ -75,12 +74,9 @@
(let loop ([paths (if (zero? (vector-length (current-command-line-arguments))) (let loop ([paths (if (zero? (vector-length (current-command-line-arguments)))
'(".") '(".")
(vector->list (current-command-line-arguments)))]) (vector->list (current-command-line-arguments)))])
(for-each (lambda (path) (for ([path (in-list paths)])
(cond [(file-exists? path) (cond [(file-exists? path)
(when (binary-file? path) (do-file path))] (when (binary-file? path) (do-file path))]
[(directory-exists? path) [(directory-exists? path)
(parameterize ([current-directory path]) (parameterize ([current-directory path])
(loop (map path->string (directory-list))))])) (loop (map path->string (directory-list))))])))
paths))
)