change #:module-info to #:language-info for consistency with module->language-info

This commit is contained in:
Matthew Flatt 2010-04-21 18:50:16 -06:00
parent 895ca49f9c
commit 7503f8c6e9
16 changed files with 66 additions and 70 deletions

View File

@ -1,7 +1,7 @@
#lang scheme/base #lang scheme/base
(provide module-info) (provide get-info)
(define ((module-info options) key default) (define ((get-info options) key default)
(case key (case key
[(configure-runtime) `(#(htdp/bsl/runtime configure ,options))] [(configure-runtime) `(#(htdp/bsl/runtime configure ,options))]
[else default])) [else default]))

View File

@ -12,7 +12,7 @@
#:read (wrap-reader read options) #:read (wrap-reader read options)
#:read-syntax (wrap-reader read-syntax options) #:read-syntax (wrap-reader read-syntax options)
#:info (make-info options) #:info (make-info options)
#:module-info (make-module-info options) #:language-info (make-language-info options)
(define options opts))) (define options opts)))
@ -36,5 +36,5 @@
[else (use-default key default)])) [else (use-default key default)]))
(define (make-module-info options) (define (make-language-info options)
`#(htdp/bsl/module-info module-info ,options)) `#(htdp/bsl/language-info get-info ,options))

View File

@ -1,5 +1,4 @@
#lang s-exp syntax/module-reader #lang s-exp syntax/module-reader
racket/base racket/base
#:info get-info #:language-info '#(racket/language-info get-info #f)
(require racket/private/get-info)

View File

@ -1,6 +1,4 @@
#lang s-exp syntax/module-reader #lang s-exp syntax/module-reader
racket racket
#:module-info '#(racket/private/get-info get-info #f) #:language-info '#(racket/language-info get-info #f)

View File

@ -1,4 +1,4 @@
(module get-info "pre-base.ss" (module language-info "private/pre-base.ss"
(provide get-info) (provide get-info)
@ -6,6 +6,6 @@
(lambda (key default) (lambda (key default)
(case key (case key
[(configure-runtime) [(configure-runtime)
'(#(racket/private/runtime configure #f))] '(#(racket/runtime-config configure #f))]
[else default])))) [else default]))))

View File

@ -1,7 +1,4 @@
#lang s-exp syntax/module-reader #lang s-exp syntax/module-reader
racket/private/pre-base racket/private/pre-base
#:info get-info #:language-info '#(racket/language-info get-info #f)
#:module-info '#(racket/private/get-info get-info #f)
(require racket/private/get-info)

View File

@ -1,9 +0,0 @@
#lang scheme/base
(provide configure)
(define (configure config)
(current-prompt-read (lambda ()
(printf "> ")
(read)))
(print-as-quasiquote #t))

View File

@ -0,0 +1,10 @@
(module runtime-config '#%kernel
(#%provide configure)
(define-values (configure)
(lambda (config)
(current-prompt-read (lambda ()
(printf "> ")
(read)))
(print-as-quasiquote #t))))

View File

@ -7,7 +7,7 @@
#%module-begin) #%module-begin)
scribble-base-info scribble-base-info
scribble-base-reader-info scribble-base-reader-info
scribble-base-module-info) scribble-base-language-info)
(define-syntax-rule (module-begin lang #:wrapper1 wrapper1) (define-syntax-rule (module-begin lang #:wrapper1 wrapper1)
(#%reader-module-begin (#%reader-module-begin
@ -18,7 +18,7 @@
#:whole-body-readers? #t #:whole-body-readers? #t
#:wrapper1 wrapper1 #:wrapper1 wrapper1
#:info (scribble-base-info) #:info (scribble-base-info)
#:module-info (scribble-base-module-info))) #:language-info (scribble-base-language-info)))
;; Settings that apply just to the surface syntax: ;; Settings that apply just to the surface syntax:
(define (scribble-base-reader-info) (define (scribble-base-reader-info)
@ -36,6 +36,5 @@
(dynamic-require 'scribble/tools/drscheme-buttons 'drscheme-buttons)] (dynamic-require 'scribble/tools/drscheme-buttons 'drscheme-buttons)]
[else ((scribble-base-reader-info) key defval default)]))) [else ((scribble-base-reader-info) key defval default)])))
(define (scribble-base-module-info) (define (scribble-base-language-info)
(lambda (modpath data) '#(racket/language-info get-info #f))
#f))

View File

@ -6,11 +6,11 @@ scribble/lp/lang/lang
#:read-syntax read-syntax-inside #:read-syntax read-syntax-inside
#:whole-body-readers? #t #:whole-body-readers? #t
#:info (scribble-base-info) #:info (scribble-base-info)
#:module-info (scribble-base-module-info) #:language-info (scribble-base-language-info)
(require scribble/reader (require scribble/reader
(only-in scribble/base/reader (only-in scribble/base/reader
scribble-base-info scribble-base-info
scribble-base-module-info)) scribble-base-language-info))

View File

@ -1,2 +1,4 @@
#lang s-exp syntax/module-reader #lang s-exp syntax/module-reader
slideshow slideshow
#:language-info '#(racket/language-info get-info #f)

View File

@ -41,7 +41,7 @@
[#:wrapper2 ~wrapper2 #'#f] [#:wrapper2 ~wrapper2 #'#f]
[#:whole-body-readers? ~whole-body-readers? #'#f] [#:whole-body-readers? ~whole-body-readers? #'#f]
[#:info ~info #'#f] [#:info ~info #'#f]
[#:module-info ~module-get-info #'#f] [#:language-info ~module-get-info #'#f]
[(when (equal? (and lang #t) (and ~lang #t)) [(when (equal? (and lang #t) (and ~lang #t))
(err (string-append (err (string-append
"must specify either a module language, or #:language" "must specify either a module language, or #:language"

View File

@ -33,7 +33,7 @@ language, though it may also be @scheme[require]d to get
(code:line #:wrapper2 wrapper2-expr) (code:line #:wrapper2 wrapper2-expr)
(code:line #:language lang-expr) (code:line #:language lang-expr)
(code:line #:info info-expr) (code:line #:info info-expr)
(code:line #:module-info module-info-expr)]) (code:line #:language-info language-info-expr)])
#:contracts ([read-expr (input-port? . -> . any/c)] #:contracts ([read-expr (input-port? . -> . any/c)]
[read-syntax-expr (any/c input-port? . -> . any/c)] [read-syntax-expr (any/c input-port? . -> . any/c)]
[whole-expr any/c] [whole-expr any/c]
@ -185,41 +185,41 @@ identifiers used by the @scheme[reader-option]s.
function) currently just returns the default for function) currently just returns the default for
@scheme['color-lexer].} @scheme['color-lexer].}
@item{@scheme[#:module-info] specifies an implementation of @item{@scheme[#:language-info] specifies an implementation of
reflective information that is used by external tools to reflective information that is used by external tools to
manipulate the @emph{compiled} form of modules in the language manipulate the @emph{compiled} or @emph{declared} form of
@scheme[_something]. For example, when MzScheme starts a modules in the language @scheme[_something]. For example, when
program, it uses information attached to the compiled main MzScheme starts a program, it uses information attached to the
module to initialize the run-time environment. compiled main module to initialize the run-time environment.
Since the compiled form exists at a different time than when Since the compiled/declared form exists at a different time
the source is read, a @scheme[#:module-info] specification is a than when the source is read, a @scheme[#:language-info]
vector that indicates an implementation of the reflective specification is a vector that indicates an implementation of
information, instead of a direct implementation as a function the reflective information, instead of a direct implementation
like @scheme[#:info]. The first element of the vector is a as a function like @scheme[#:info]. The first element of the
module path, the second is a symbol corresponding to a function vector is a module path, the second is a symbol corresponding
exported from the module, and the last element is a value to be to a function exported from the module, and the last element is
passed to the function. The last value in the vector must be a value to be passed to the function. The last value in the
one that can be written with @scheme[write] and read back with vector must be one that can be written with @scheme[write] and
@scheme[read]. When the exported function indicated by the read back with @scheme[read]. When the exported function
first two vector elements is called with the value from the indicated by the first two vector elements is called with the
last vector element, the result should be a function or two value from the last vector element, the result should be a
arguments: a symbol and a default value. The symbol and default function or two arguments: a symbol and a default value. The
value are used as for the @scheme[#:info] function (but without symbol and default value are used as for the @scheme[#:info]
an extra default-filtering function). function (but without an extra default-filtering function).
The value specified by @scheme[#:module-info] is attached to The value specified by @scheme[#:language-info] is attached to
the @scheme[module] form that is parsed from source through the the @scheme[module] form that is parsed from source through the
@scheme['module-language] syntax property. See @scheme[module] @scheme['module-language] syntax property. See @scheme[module]
for more information. for more information.
The expression after @scheme[#:module-info] is placed into a The expression after @scheme[#:language-info] is placed into a
context where @scheme[language-module] are context where @scheme[language-module] are
@scheme[language-data] are bound, the same as for @scheme[language-data] are bound, the same as for
@scheme[#:info]. @scheme[#:info].
In the case of the MzScheme run-time configuration example, In the case of the MzScheme run-time configuration example,
MzScheme uses the @scheme[#:module-info] vector to obtain a MzScheme uses the @scheme[#:language-info] vector to obtain a
function, and then it passes @scheme['configure-runtime] to the function, and then it passes @scheme['configure-runtime] to the
function to obtain information about configuring the runtime function to obtain information about configuring the runtime
environment. See also @secref[#:doc refman "configure-runtime"].} environment. See also @secref[#:doc refman "configure-runtime"].}

View File

@ -1,10 +1,10 @@
#lang scheme/base #lang scheme/base
(require typed-scheme/typed-reader) (require typed-scheme/typed-reader)
(provide module-info configure) (provide get-info configure)
(define ((module-info arg) key default) (define ((get-info arg) key default)
(case key (case key
[(configure-runtime) `(#(typed-scheme/module-info configure ()))] [(configure-runtime) `(#(typed-scheme/language-info configure ()))]
[else default])) [else default]))
;; options currently always empty ;; options currently always empty

View File

@ -5,14 +5,14 @@ typed/scheme/base
#:read r:read #:read r:read
#:read-syntax r:read-syntax #:read-syntax r:read-syntax
#:info make-info #:info make-info
#:module-info make-module-info #:language-info make-language-info
(define (make-info key default use-default) (define (make-info key default use-default)
(case key (case key
[else (use-default key default)])) [else (use-default key default)]))
(define make-module-info (define make-language-info
`#(typed-scheme/module-info module-info ())) `#(typed-scheme/language-info get-info ()))
(require (prefix-in r: typed-scheme/typed-reader)) (require (prefix-in r: typed-scheme/typed-reader))

View File

@ -5,14 +5,14 @@ typed/scheme
#:read r:read #:read r:read
#:read-syntax r:read-syntax #:read-syntax r:read-syntax
#:info make-info #:info make-info
#:module-info make-module-info #:language-info make-language-info
(define (make-info key default use-default) (define (make-info key default use-default)
(case key (case key
[else (use-default key default)])) [else (use-default key default)]))
(define make-module-info (define make-language-info
`#(typed-scheme/module-info module-info ())) `#(typed-scheme/language-info get-info ()))
(require (prefix-in r: typed-scheme/typed-reader)) (require (prefix-in r: typed-scheme/typed-reader))