changed drscheme-language-readers to allow relative path specs and fixed a bug

svn: r2070
This commit is contained in:
Robby Findler 2006-02-01 16:18:45 +00:00
parent 8cd33974de
commit 8e4b5d3f3b

View File

@ -1148,7 +1148,6 @@
(λ () (λ ()
(map (λ (lang-position) #f) (map (λ (lang-position) #f)
lang-positions)))]) lang-positions)))])
(printf "dir ~s lang-positions ~s\n" directory lang-positions)
(cond (cond
[(and (list? lang-positions) [(and (list? lang-positions)
(andmap (λ (lang-position numbers) (andmap (λ (lang-position numbers)
@ -1178,7 +1177,7 @@
;; approximation (no good test, really) ;; approximation (no good test, really)
;; since it depends on the value of a mz ;; since it depends on the value of a mz
;; parameter to interpret the module spec ;; parameter to interpret the module spec
(or (eq? x #f) (symbol? x) (pair? x))) (or (string? x) (eq? x #f) (symbol? x) (pair? x)))
reader-specs) reader-specs)
(= (length lang-positions) (= (length lang-positions)
@ -1203,12 +1202,17 @@
(format "uncaught exception: ~s" x))) (format "uncaught exception: ~s" x)))
read-syntax/namespace-introduce)]) read-syntax/namespace-introduce)])
(contract (contract
(opt-> (any/c) (opt-> ()
(port? (list/c (and/c number? integer? exact? (>=/c 0)) (any/c port?)
(and/c number? integer? exact? (>=/c 0))
(and/c number? integer? exact? (>=/c 0))))
(or/c syntax? eof-object?)) (or/c syntax? eof-object?))
(dynamic-require reader-spec 'read-syntax) (dynamic-require
(cond
[(string? reader-spec)
(build-path
directory
(platform-independent-string->path reader-spec))]
[else reader-spec])
'read-syntax)
(string->symbol (format "~s" lang-position)) (string->symbol (format "~s" lang-position))
'drscheme)) 'drscheme))
read-syntax/namespace-introduce)]) read-syntax/namespace-introduce)])