A ton of @scheme*' ->
@racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries rather than to `scheme/*' ones. original commit: ac26fe75546b5182d78f18c2cd882f0f440849e2
This commit is contained in:
parent
ad8ba406ee
commit
0ed2447eb9
|
@ -66,7 +66,7 @@
|
|||
(list (smaller (elemref '(chunk tag) #:underline? #f
|
||||
str
|
||||
rest ...))))
|
||||
(schemeblock expr ...))))))]))
|
||||
(racketblock expr ...))))))]))
|
||||
|
||||
(define-syntax (chunkref stx)
|
||||
(syntax-case stx ()
|
||||
|
|
|
@ -218,9 +218,9 @@
|
|||
(car content)))
|
||||
spacer ":" spacer
|
||||
(case kind
|
||||
[(class) (scheme class?)]
|
||||
[(interface) (scheme interface?)]
|
||||
[(mixin) (schemeblockelem (class? . -> . class?))])))))))
|
||||
[(class) (racket class?)]
|
||||
[(interface) (racket interface?)]
|
||||
[(mixin) (racketblockelem (class? . -> . class?))])))))))
|
||||
(if super
|
||||
(list
|
||||
(list (make-flow
|
||||
|
|
|
@ -55,21 +55,21 @@
|
|||
stx
|
||||
id)))
|
||||
(syntax->list #'(lit ...)))
|
||||
#'(with-togetherable-scheme-variables
|
||||
#'(with-togetherable-racket-variables
|
||||
(lit ...)
|
||||
([form spec] [form spec1] ...
|
||||
([form spec] [form spec1] ...
|
||||
[non-term (non-term-id non-term-form ...)] ...)
|
||||
(*defforms (quote-syntax/loc defined-id)
|
||||
'(spec spec1 ...)
|
||||
(list (lambda (x) (schemeblock0/form new-spec))
|
||||
(lambda (ignored) (schemeblock0/form spec1)) ...)
|
||||
(list (lambda (x) (racketblock0/form new-spec))
|
||||
(lambda (ignored) (racketblock0/form spec1)) ...)
|
||||
'((non-term-id non-term-form ...) ...)
|
||||
(list (list (lambda () (scheme non-term-id))
|
||||
(lambda () (schemeblock0/form non-term-form))
|
||||
(list (list (lambda () (racket non-term-id))
|
||||
(lambda () (racketblock0/form non-term-form))
|
||||
...)
|
||||
...)
|
||||
(list (list (lambda () (scheme contract-nonterm))
|
||||
(lambda () (schemeblock0 contract-expr)))
|
||||
(list (list (lambda () (racket contract-nonterm))
|
||||
(lambda () (racketblock0 contract-expr)))
|
||||
...)
|
||||
(lambda () (list desc ...)))))]
|
||||
[(fm #:id defined-id #:literals (lit ...) [spec spec1 ...]
|
||||
|
@ -156,14 +156,14 @@
|
|||
stx
|
||||
id)))
|
||||
(syntax->list #'(lit ...)))
|
||||
#'(with-togetherable-scheme-variables
|
||||
#'(with-togetherable-racket-variables
|
||||
(lit ...)
|
||||
([form/none spec])
|
||||
(*defforms #f
|
||||
'(spec) (list (lambda (ignored) (schemeblock0/form spec)))
|
||||
'(spec) (list (lambda (ignored) (racketblock0/form spec)))
|
||||
null null
|
||||
(list (list (lambda () (scheme contract-id))
|
||||
(lambda () (schemeblock0 contract-expr)))
|
||||
(list (list (lambda () (racket contract-id))
|
||||
(lambda () (racketblock0 contract-expr)))
|
||||
...)
|
||||
(lambda () (list desc ...)))))]
|
||||
[(fm #:literals (lit ...) spec desc ...)
|
||||
|
@ -182,7 +182,7 @@
|
|||
(define-syntax (defidform stx)
|
||||
(syntax-case stx ()
|
||||
[(_ spec-id desc ...)
|
||||
#'(with-togetherable-scheme-variables
|
||||
#'(with-togetherable-racket-variables
|
||||
()
|
||||
()
|
||||
(*defforms (quote-syntax/loc spec-id)
|
||||
|
@ -212,18 +212,18 @@
|
|||
[(_ has-kw? #:literals (lit ...) spec ([non-term-id non-term-form ...] ...)
|
||||
#:contracts ([contract-nonterm contract-expr] ...)
|
||||
desc ...)
|
||||
(with-scheme-variables
|
||||
(with-racket-variables
|
||||
(lit ...)
|
||||
([form/maybe (has-kw? spec)]
|
||||
[non-term (non-term-id non-term-form ...)] ...)
|
||||
(*specsubform 'spec '(lit ...) (lambda () (schemeblock0/form spec))
|
||||
(*specsubform 'spec '(lit ...) (lambda () (racketblock0/form spec))
|
||||
'((non-term-id non-term-form ...) ...)
|
||||
(list (list (lambda () (scheme non-term-id))
|
||||
(lambda () (schemeblock0/form non-term-form))
|
||||
(list (list (lambda () (racket non-term-id))
|
||||
(lambda () (racketblock0/form non-term-form))
|
||||
...)
|
||||
...)
|
||||
(list (list (lambda () (scheme contract-nonterm))
|
||||
(lambda () (schemeblock0 contract-expr)))
|
||||
(list (list (lambda () (racket contract-nonterm))
|
||||
(lambda () (racketblock0 contract-expr)))
|
||||
...)
|
||||
(lambda () (list desc ...))))]
|
||||
[(_ has-kw? #:literals (lit ...) spec ([non-term-id non-term-form ...] ...)
|
||||
|
@ -272,7 +272,7 @@
|
|||
desc ...)]))
|
||||
|
||||
(define-syntax-rule (specsubform/inline spec desc ...)
|
||||
(with-scheme-variables
|
||||
(with-racket-variables
|
||||
()
|
||||
([form/maybe (#f spec)])
|
||||
(*specsubform 'spec null #f null null null (lambda () (list desc ...)))))
|
||||
|
@ -280,26 +280,26 @@
|
|||
(define-syntax racketgrammar
|
||||
(syntax-rules ()
|
||||
[(_ #:literals (lit ...) id clause ...)
|
||||
(with-scheme-variables
|
||||
(with-racket-variables
|
||||
(lit ...)
|
||||
([non-term (id clause ...)])
|
||||
(*racketgrammar '(lit ...)
|
||||
'(id clause ...)
|
||||
(lambda ()
|
||||
(list (list (scheme id)
|
||||
(schemeblock0/form clause) ...)))))]
|
||||
(list (list (racket id)
|
||||
(racketblock0/form clause) ...)))))]
|
||||
[(_ id clause ...) (racketgrammar #:literals () id clause ...)]))
|
||||
|
||||
(define-syntax racketgrammar*
|
||||
(syntax-rules ()
|
||||
[(_ #:literals (lit ...) [id clause ...] ...)
|
||||
(with-scheme-variables
|
||||
(with-racket-variables
|
||||
(lit ...)
|
||||
([non-term (id clause ...)] ...)
|
||||
(*racketgrammar '(lit ...)
|
||||
'(id ... clause ... ...)
|
||||
(lambda ()
|
||||
(list (list (scheme id) (schemeblock0/form clause) ...)
|
||||
(list (list (racket id) (racketblock0/form clause) ...)
|
||||
...))))]
|
||||
[(_ [id clause ...] ...)
|
||||
(racketgrammar* #:literals () [id clause ...] ...)]))
|
||||
|
@ -363,7 +363,7 @@
|
|||
(list (let ([l (map (lambda (sub)
|
||||
(map (lambda (f) (f)) sub))
|
||||
sub-procs)])
|
||||
(*schemerawgrammars "specgrammar"
|
||||
(*racketrawgrammars "specgrammar"
|
||||
(map car l)
|
||||
(map cdr l))))))))
|
||||
(make-contracts-table contract-procs)))
|
||||
|
@ -391,13 +391,13 @@
|
|||
(list (let ([l (map (lambda (sub)
|
||||
(map (lambda (f) (f)) sub))
|
||||
sub-procs)])
|
||||
(*schemerawgrammars "specgrammar"
|
||||
(*racketrawgrammars "specgrammar"
|
||||
(map car l)
|
||||
(map cdr l))))))))
|
||||
(make-contracts-table contract-procs))))
|
||||
(flow-paragraphs (decode-flow (content-thunk)))))))
|
||||
|
||||
(define (*schemerawgrammars style nonterms clauseses)
|
||||
(define (*racketrawgrammars style nonterms clauseses)
|
||||
(make-table
|
||||
`((valignment baseline baseline baseline baseline baseline)
|
||||
(alignment right left center left left)
|
||||
|
@ -417,12 +417,12 @@
|
|||
(cdr clauses))))
|
||||
nonterms clauseses))))
|
||||
|
||||
(define (*schemerawgrammar style nonterm clause1 . clauses)
|
||||
(*schemerawgrammars style (list nonterm) (list (cons clause1 clauses))))
|
||||
(define (*racketrawgrammar style nonterm clause1 . clauses)
|
||||
(*racketrawgrammars style (list nonterm) (list (cons clause1 clauses))))
|
||||
|
||||
(define (*racketgrammar lits s-expr clauseses-thunk)
|
||||
(let ([l (clauseses-thunk)])
|
||||
(*schemerawgrammars #f
|
||||
(*racketrawgrammars #f
|
||||
(map (lambda (x)
|
||||
(make-element #f
|
||||
(list (hspace 2)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
(define-syntax defmodule*/no-declare
|
||||
(syntax-rules ()
|
||||
[(_ #:require-form req (name ...) . content)
|
||||
(*defmodule (list (schememodname name) ...)
|
||||
(*defmodule (list (racketmodname name) ...)
|
||||
#f
|
||||
#f
|
||||
(list . content)
|
||||
|
@ -52,19 +52,30 @@
|
|||
(define-syntax defmodulelang*/no-declare
|
||||
(syntax-rules ()
|
||||
[(_ (lang ...) #:module-paths (modpath ...) . content)
|
||||
(*defmodule (list lang ...) (list (schememodname modpath) ...) #t (list . content) #f)]
|
||||
(*defmodule (list lang ...)
|
||||
(list (racketmodname modpath) ...)
|
||||
#t (list . content) #f)]
|
||||
[(_ (lang ...) . content)
|
||||
(*defmodule (list (schememodname lang) ...) #f #t (list . content) #f)]))
|
||||
(*defmodule (list (racketmodname lang) ...)
|
||||
#f #t (list . content) #f)]))
|
||||
|
||||
(define-syntax defmodulelang*
|
||||
(syntax-rules ()
|
||||
[(_ (name ...) #:module-paths (modpath ...) #:use-sources (pname ...) . content)
|
||||
[(_ (name ...) #:module-paths (modpath ...)
|
||||
#:use-sources (pname ...)
|
||||
. content)
|
||||
(begin (declare-exporting modpath ... #:use-sources (pname ...))
|
||||
(defmodulelang*/no-declare (name ...) #:module-paths (modpath ...) . content))]
|
||||
(defmodulelang*/no-declare (name ...)
|
||||
#:module-paths (modpath ...)
|
||||
. content))]
|
||||
[(_ (name ...) #:module-paths (modpath ...) . content)
|
||||
(defmodulelang* (name ...) #:module-paths (modpath ...) #:use-sources () . content)]
|
||||
(defmodulelang* (name ...)
|
||||
#:module-paths (modpath ...)
|
||||
#:use-sources () . content)]
|
||||
[(_ (name ...) #:use-sources (pname ...) . content)
|
||||
(defmodulelang* ((schememodname name) ...) #:module-paths (name ...) #:use-sources (pname ...) . content)]
|
||||
(defmodulelang* ((racketmodname name) ...)
|
||||
#:module-paths (name ...)
|
||||
#:use-sources (pname ...) . content)]
|
||||
[(_ (name ...) . content)
|
||||
(defmodulelang* (name ...) #:use-sources () . content)]))
|
||||
|
||||
|
@ -76,7 +87,8 @@
|
|||
(defmodulelang* (lang) . content)]))
|
||||
|
||||
(define-syntax-rule (defmodulereader*/no-declare (lang ...) . content)
|
||||
(*defmodule (list (schememodname lang) ...) #f 'reader (list . content) #f))
|
||||
(*defmodule (list (racketmodname lang) ...)
|
||||
#f 'reader (list . content) #f))
|
||||
|
||||
(define-syntax defmodulereader*
|
||||
(syntax-rules ()
|
||||
|
@ -105,13 +117,13 @@
|
|||
spacer
|
||||
(case lang
|
||||
[(#f)
|
||||
(list (scheme (#,req #,(make-defschememodname name modpath))))]
|
||||
(list (racket (#,req #,(make-defracketmodname name modpath))))]
|
||||
[(#t)
|
||||
(list (hash-lang) spacer (make-defschememodname name modpath))]
|
||||
(list (hash-lang) spacer (make-defracketmodname name modpath))]
|
||||
[(reader)
|
||||
(list (schememetafont "#reader") spacer (make-defschememodname name modpath))]
|
||||
(list (racketmetafont "#reader") spacer (make-defracketmodname name modpath))]
|
||||
[(just-lang)
|
||||
(list (hash-lang) spacer (make-defschememodname name modpath))])))))))
|
||||
(list (hash-lang) spacer (make-defracketmodname name modpath))])))))))
|
||||
names
|
||||
modpaths))
|
||||
(append (map (lambda (modpath)
|
||||
|
@ -119,7 +131,7 @@
|
|||
modpaths)
|
||||
(flow-paragraphs (decode-flow content)))))))
|
||||
|
||||
(define (make-defschememodname mn mp)
|
||||
(define (make-defracketmodname mn mp)
|
||||
(let ([name-str (element->string mn)]
|
||||
[path-str (element->string mp)])
|
||||
(make-index-element #f
|
||||
|
|
|
@ -34,26 +34,26 @@
|
|||
(make-element meta-color (list "...+")))
|
||||
|
||||
(define (make-openers n)
|
||||
(schemeparenfont
|
||||
(racketparenfont
|
||||
(case n [(1) "("] [(0) ""] [(2) "(("] [else (make-string n #\()])))
|
||||
(define (make-closers n)
|
||||
(schemeparenfont
|
||||
(racketparenfont
|
||||
(case n [(1) ")"] [(0) ""] [(2) "))"] [else (make-string n #\()])))
|
||||
|
||||
(define-syntax (arg-contract stx)
|
||||
(syntax-case stx (... ...+ _...superclass-args...)
|
||||
[(_ [id contract])
|
||||
(identifier? #'id)
|
||||
#'(schemeblock0 contract)]
|
||||
#'(racketblock0 contract)]
|
||||
[(_ [id contract val])
|
||||
(identifier? #'id)
|
||||
#'(schemeblock0 contract)]
|
||||
#'(racketblock0 contract)]
|
||||
[(_ [kw id contract])
|
||||
(and (keyword? (syntax-e #'kw)) (identifier? #'id))
|
||||
#'(schemeblock0 contract)]
|
||||
#'(racketblock0 contract)]
|
||||
[(_ [kw id contract val])
|
||||
(and (keyword? (syntax-e #'kw)) (identifier? #'id))
|
||||
#'(schemeblock0 contract)]
|
||||
#'(racketblock0 contract)]
|
||||
[(_ (... ...)) #'#f]
|
||||
[(_ (... ...+)) #'#f]
|
||||
[(_ _...superclass-args...) #'#f]
|
||||
|
@ -66,13 +66,13 @@
|
|||
#'#f]
|
||||
[(_ [id contract val])
|
||||
(identifier? #'id)
|
||||
#'(schemeblock0 val)]
|
||||
#'(racketblock0 val)]
|
||||
[(_ [kw id contract])
|
||||
(keyword? (syntax-e #'kw))
|
||||
#'#f]
|
||||
[(_ [kw id contract val])
|
||||
(keyword? (syntax-e #'kw))
|
||||
#'(schemeblock0 val)]
|
||||
#'(racketblock0 val)]
|
||||
[_ #'#f]))
|
||||
|
||||
(define-syntax (extract-proc-id stx)
|
||||
|
@ -105,12 +105,12 @@
|
|||
(define-syntax (result-contract stx)
|
||||
(syntax-case stx (values)
|
||||
[(_ (values c ...))
|
||||
#'(list (schemeblock0 c) ...)]
|
||||
#'(list (racketblock0 c) ...)]
|
||||
[(_ c)
|
||||
(if (string? (syntax-e #'c))
|
||||
(raise-syntax-error 'defproc
|
||||
"expected a result contract, found a string" #'c)
|
||||
#'(schemeblock0 c))]))
|
||||
#'(racketblock0 c))]))
|
||||
|
||||
(define-syntax-rule (defproc (id arg ...) result desc ...)
|
||||
(defproc* [[(id arg ...) result]] desc ...))
|
||||
|
@ -120,7 +120,7 @@
|
|||
[(_ [[proto result] ...] desc ...)
|
||||
(defproc* #:mode procedure #:within #f [[proto result] ...] desc ...)]
|
||||
[(_ #:mode m #:within cl [[proto result] ...] desc ...)
|
||||
(with-togetherable-scheme-variables
|
||||
(with-togetherable-racket-variables
|
||||
()
|
||||
([proc proto] ...)
|
||||
(*defproc 'm (quote-syntax/loc cl)
|
||||
|
@ -142,11 +142,11 @@
|
|||
(if (arg-kw arg)
|
||||
(if (eq? mode 'new)
|
||||
(make-element
|
||||
#f (list (schemeparenfont "[")
|
||||
(schemeidfont (keyword->string (arg-kw arg)))
|
||||
#f (list (racketparenfont "[")
|
||||
(racketidfont (keyword->string (arg-kw arg)))
|
||||
spacer
|
||||
(to-element (make-var-id (arg-id arg)))
|
||||
(schemeparenfont "]")))
|
||||
(racketparenfont "]")))
|
||||
(make-element
|
||||
#f (list (to-element (arg-kw arg))
|
||||
spacer
|
||||
|
@ -237,14 +237,14 @@
|
|||
(define tagged
|
||||
(cond
|
||||
[(eq? mode 'new)
|
||||
(make-element #f (list (scheme new) spacer (to-element within-id)))]
|
||||
(make-element #f (list (racket new) spacer (to-element within-id)))]
|
||||
[(eq? mode 'make)
|
||||
(make-element
|
||||
#f (list (scheme make-object) spacer (to-element within-id)))]
|
||||
#f (list (racket make-object) spacer (to-element within-id)))]
|
||||
[(eq? mode 'send)
|
||||
(make-element
|
||||
#f
|
||||
(list (scheme send) spacer
|
||||
(list (racket send) spacer
|
||||
(name-this-object (syntax-e within-id)) spacer
|
||||
(if first?
|
||||
(let* ([mname (extract-id prototype)]
|
||||
|
@ -350,7 +350,7 @@
|
|||
(append-map (lambda (arg)
|
||||
(list spacer ((arg->elem #t) arg)))
|
||||
args))
|
||||
,(schemeparenfont ")"))))
|
||||
,(racketparenfont ")"))))
|
||||
(if result-next-line? null end))))
|
||||
;; The multi-line case:
|
||||
(let ([not-end (if result-next-line?
|
||||
|
@ -403,7 +403,7 @@
|
|||
[(null? ((if dots-next? cddr cdr) args))
|
||||
(make-element
|
||||
#f
|
||||
(list a next (schemeparenfont ")")))]
|
||||
(list a next (racketparenfont ")")))]
|
||||
[(equal? next "") a]
|
||||
[else
|
||||
(make-element #f (list a next))])))
|
||||
|
@ -544,12 +544,12 @@
|
|||
|
||||
(define-syntax-rule (**defstruct name ([field field-contract] ...) immutable?
|
||||
transparent? prefab? cname extra-cname? desc ...)
|
||||
(with-togetherable-scheme-variables
|
||||
(with-togetherable-racket-variables
|
||||
()
|
||||
()
|
||||
(*defstruct (quote-syntax/loc name) 'name (quote-syntax/loc cname) extra-cname?
|
||||
'([field field-contract] ...)
|
||||
(list (lambda () (schemeblock0 field-contract)) ...)
|
||||
(list (lambda () (racketblock0 field-contract)) ...)
|
||||
immutable? transparent? prefab? (lambda () (list desc ...)))))
|
||||
|
||||
(define (*defstruct stx-id name alt-cname-id extra-cname?
|
||||
|
@ -640,7 +640,7 @@
|
|||
(make-omitable-paragraph
|
||||
(list
|
||||
(to-element
|
||||
`(,(scheme struct)
|
||||
`(,(racket struct)
|
||||
,the-name
|
||||
,(map field-view fields)))))
|
||||
(let* ([one-right-column?
|
||||
|
@ -658,8 +658,8 @@
|
|||
(append
|
||||
(list (to-flow (make-element #f
|
||||
(list
|
||||
(schemeparenfont "(")
|
||||
(scheme struct))))
|
||||
(racketparenfont "(")
|
||||
(racket struct))))
|
||||
flow-spacer)
|
||||
(if one-right-column?
|
||||
(list (to-flow (make-element
|
||||
|
@ -671,11 +671,11 @@
|
|||
(if (and immutable?
|
||||
(not transparent?)
|
||||
(not cname-id))
|
||||
(list (schemeparenfont ")"))
|
||||
(list (racketparenfont ")"))
|
||||
null)))))
|
||||
(list (to-flow the-name)
|
||||
(to-flow (make-element
|
||||
#f (list spacer (schemeparenfont "("))))
|
||||
#f (list spacer (racketparenfont "("))))
|
||||
(to-flow (to-element (field-view (car fields))))))))
|
||||
(if (short-width . < . max-proto-width)
|
||||
null
|
||||
|
@ -692,7 +692,7 @@
|
|||
(if (null? (cdr fields))
|
||||
(make-element
|
||||
#f
|
||||
(list e (schemeparenfont
|
||||
(list e (racketparenfont
|
||||
(if (and immutable?
|
||||
(not transparent?)
|
||||
(not cname-id))
|
||||
|
@ -712,7 +712,7 @@
|
|||
(to-element cname-id))
|
||||
(if (and immutable?
|
||||
(not transparent?))
|
||||
(list (schemeparenfont ")"))
|
||||
(list (racketparenfont ")"))
|
||||
null))))))
|
||||
null)
|
||||
(cond
|
||||
|
@ -724,13 +724,13 @@
|
|||
(list (if prefab?
|
||||
(to-element '#:prefab)
|
||||
(to-element '#:transparent))
|
||||
(schemeparenfont ")"))))))]
|
||||
(racketparenfont ")"))))))]
|
||||
[(not immutable?)
|
||||
(list
|
||||
(a-right-column (to-flow (make-element
|
||||
#f
|
||||
(list (to-element '#:mutable)
|
||||
(schemeparenfont ")"))))))]
|
||||
(racketparenfont ")"))))))]
|
||||
[transparent?
|
||||
(list
|
||||
(a-right-column (to-flow (make-element
|
||||
|
@ -738,7 +738,7 @@
|
|||
(list (if prefab?
|
||||
(to-element '#:prefab)
|
||||
(to-element '#:transparent))
|
||||
(schemeparenfont ")"))))))]
|
||||
(racketparenfont ")"))))))]
|
||||
[else null])))))))))
|
||||
(map (lambda (v field-contract)
|
||||
(cond
|
||||
|
@ -763,19 +763,19 @@
|
|||
;; ----------------------------------------
|
||||
|
||||
(define-syntax-rule (defthing id result desc ...)
|
||||
(with-togetherable-scheme-variables
|
||||
(with-togetherable-racket-variables
|
||||
()
|
||||
()
|
||||
(*defthing (list (quote-syntax/loc id)) (list 'id) #f
|
||||
(list (schemeblock0 result))
|
||||
(list (racketblock0 result))
|
||||
(lambda () (list desc ...)))))
|
||||
|
||||
(define-syntax-rule (defthing* ([id result] ...) desc ...)
|
||||
(with-togetherable-scheme-variables
|
||||
(with-togetherable-racket-variables
|
||||
()
|
||||
()
|
||||
(*defthing (list (quote-syntax/loc id) ...) (list 'id ...) #f
|
||||
(list (schemeblock0 result) ...)
|
||||
(list (racketblock0 result) ...)
|
||||
(lambda () (list desc ...)))))
|
||||
|
||||
(define (*defthing stx-ids names form? result-contracts content-thunk
|
||||
|
@ -887,7 +887,7 @@
|
|||
(list content)
|
||||
tag
|
||||
(list name)
|
||||
(list (schemeidfont (make-element value-link-color
|
||||
(list (racketidfont (make-element value-link-color
|
||||
(list name))))
|
||||
(with-exporting-libraries
|
||||
(lambda (libs)
|
||||
|
|
|
@ -15,9 +15,9 @@
|
|||
racketresultblock racketresultblock0
|
||||
RACKETRESULTBLOCK RACKETRESULTBLOCK0
|
||||
racketblockelem
|
||||
racketinput RACKETINPUT
|
||||
racketinput RACKETINPUT
|
||||
racketinput0 RACKETINPUT0
|
||||
racketmod
|
||||
racketmod
|
||||
racketmod0
|
||||
racket RACKET racket/form racketresult racketid
|
||||
racketmodname
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
[racketparenfont schemeparenfont]
|
||||
[racketkeywordfont schemekeywordfont]
|
||||
[racketmetafont schememetafont])
|
||||
|
||||
|
||||
(provide void-const
|
||||
undefined-const)
|
||||
(provide/contract
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
sigelem)
|
||||
|
||||
(define-syntax-rule (defsignature name (super ...) body ...)
|
||||
(with-togetherable-scheme-variables
|
||||
(with-togetherable-racket-variables
|
||||
()
|
||||
()
|
||||
(*defsignature (quote-syntax name)
|
||||
|
@ -29,7 +29,7 @@
|
|||
#t)))
|
||||
|
||||
(define-syntax-rule (defsignature/splice name (super ...) body ...)
|
||||
(with-togetherable-scheme-variables
|
||||
(with-togetherable-racket-variables
|
||||
()
|
||||
()
|
||||
(*defsignature (quote-syntax name)
|
||||
|
|
|
@ -15,16 +15,16 @@
|
|||
(provide/contract
|
||||
[struct (box-splice splice) ([run list?])]) ; XXX ugly copying
|
||||
(provide deftogether *deftogether
|
||||
with-scheme-variables
|
||||
with-togetherable-scheme-variables)
|
||||
with-racket-variables
|
||||
with-togetherable-racket-variables)
|
||||
|
||||
(begin-for-syntax (define-struct deftogether-tag () #:omit-define-syntaxes))
|
||||
|
||||
(define-syntax (with-togetherable-scheme-variables stx)
|
||||
(define-syntax (with-togetherable-racket-variables stx)
|
||||
(syntax-case stx ()
|
||||
[(_ . rest)
|
||||
(let ([result (syntax/loc stx
|
||||
(with-togetherable-scheme-variables* . rest))]
|
||||
(with-togetherable-racket-variables* . rest))]
|
||||
[ctx (syntax-local-context)])
|
||||
(if (and (pair? ctx) (deftogether-tag? (car ctx)))
|
||||
;; Make it transparent, so deftogether is allowed to pull it apart
|
||||
|
@ -36,10 +36,10 @@
|
|||
;; that we introduce later.
|
||||
result))]))
|
||||
|
||||
(define-syntax-rule (with-togetherable-scheme-variables* . rest)
|
||||
(with-scheme-variables . rest))
|
||||
(define-syntax-rule (with-togetherable-racket-variables* . rest)
|
||||
(with-racket-variables . rest))
|
||||
|
||||
(define-syntax (with-scheme-variables stx)
|
||||
(define-syntax (with-racket-variables stx)
|
||||
(syntax-case stx ()
|
||||
[(_ lits ([kind s-exp] ...) body)
|
||||
(let ([ht (make-bound-identifier-mapping)]
|
||||
|
@ -137,10 +137,10 @@
|
|||
def
|
||||
(list (make-deftogether-tag))
|
||||
(cons
|
||||
#'with-togetherable-scheme-variables*
|
||||
#'with-togetherable-racket-variables*
|
||||
(kernel-form-identifier-list)))])
|
||||
(syntax-case exp-def (with-togetherable-scheme-variables*)
|
||||
[(with-togetherable-scheme-variables* lits vars decl)
|
||||
(syntax-case exp-def (with-togetherable-racket-variables*)
|
||||
[(with-togetherable-racket-variables* lits vars decl)
|
||||
exp-def]
|
||||
[_
|
||||
(raise-syntax-error
|
||||
|
@ -149,7 +149,7 @@
|
|||
stx
|
||||
def)])))
|
||||
(syntax->list #'(def ...)))])
|
||||
#'(with-togetherable-scheme-variables
|
||||
#'(with-togetherable-racket-variables
|
||||
(lit ... ...)
|
||||
(var ... ...)
|
||||
(*deftogether (list decl ...) (lambda () (list . body)))))]))
|
||||
|
|
|
@ -629,7 +629,7 @@ for Latex output (see @secref["extra-style"]). The following
|
|||
|
||||
Produces another block during the @tech{traverse pass}, eventually.
|
||||
|
||||
The @scheme[traverse] procedure is called with @racket[_get] and
|
||||
The @racket[traverse] procedure is called with @racket[_get] and
|
||||
@racket[_set] procedures to get and set symbol-keyed information; the
|
||||
@racket[traverse] procedure should return either a @tech{block} (which
|
||||
effectively takes the @racket[traverse-block]'s place) or a procedure
|
||||
|
@ -640,10 +640,10 @@ All @racket[traverse-element] and @racket[traverse-block]s that have
|
|||
not been replaced are forced in document order relative to each other
|
||||
during an iteration of the @tech{traverse pass}.
|
||||
|
||||
The @racket[_get] procedure passed to @scheme[traverse] takes a symbol
|
||||
The @racket[_get] procedure passed to @racket[traverse] takes a symbol
|
||||
and any value to act as a default; it returns information registered
|
||||
for the symbol or the given default if no value has been
|
||||
registered. The @racket[_set] procedure passed to @scheme[traverse]
|
||||
registered. The @racket[_set] procedure passed to @racket[traverse]
|
||||
takes a symbol and a value to registered for the symbol.
|
||||
|
||||
@margin-note*{See also @racket[cond-block] in @racketmodname[scriblib/render-cond].}
|
||||
|
@ -1204,7 +1204,7 @@ Produces the content that replaces @racket[e].}
|
|||
|
||||
Defined as
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(recursive-contract
|
||||
((symbol? any/c . -> . any/c)
|
||||
(symbol? any/c . -> . any)
|
||||
|
@ -1216,7 +1216,7 @@ Defined as
|
|||
|
||||
Defined as
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(recursive-contract
|
||||
((symbol? any/c . -> . any/c)
|
||||
(symbol? any/c . -> . any)
|
||||
|
|
|
@ -13,5 +13,5 @@ and this one:
|
|||
|
||||
that, when assembled, produce a complete program, in this case:
|
||||
|
||||
@schemeblock[(define (f x)
|
||||
@racketblock[(define (f x)
|
||||
(* x x))]
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
|
||||
@title{Racket Manual Format}
|
||||
|
||||
The @schememodname[scribble/manual] language is a major component of
|
||||
The @racketmodname[scribble/manual] language is a major component of
|
||||
Scribble, and it is documented in its own chapter:
|
||||
@secref["plt-manuals"].
|
||||
|
|
|
@ -11,31 +11,31 @@
|
|||
|
||||
@defform[(define-cite ~cite-id citet-id generate-bibliography-id)]{
|
||||
|
||||
Binds @scheme[~cite-id], @scheme[citet-id], and
|
||||
@scheme[generate-bibliography-id], which share state to accumulate and
|
||||
Binds @racket[~cite-id], @racket[citet-id], and
|
||||
@racket[generate-bibliography-id], which share state to accumulate and
|
||||
render citations.
|
||||
|
||||
The function bound to @scheme[~cite-id] produces a citation referring
|
||||
The function bound to @racket[~cite-id] produces a citation referring
|
||||
to one or more bibliography entries with a preceding non-breaking
|
||||
space, by default sorting the entries to match the bibliography order.
|
||||
It has the contract
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(->* (bib?) (#:sort? any/c) #:rest (listof bib?) element?)
|
||||
]
|
||||
|
||||
The function bound to @scheme[citet-id] generates an element suitable
|
||||
The function bound to @racket[citet-id] generates an element suitable
|
||||
for use as a noun---referring to a document or its author---for one
|
||||
or more bibliography entries which share an author. It has the contract
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(->* (bib?) () #:rest (listof bib?) element?)
|
||||
]
|
||||
|
||||
The function bound to @scheme[generate-bibliography-id] generates the
|
||||
The function bound to @racket[generate-bibliography-id] generates the
|
||||
section for the bibliography. It has the contract
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(->* () (#:tag string? #:sec-title string?) part?)
|
||||
]
|
||||
|
||||
|
@ -46,8 +46,8 @@ and for @racket[#:sec-title] is @racket["Bibliography"].
|
|||
|
||||
@defproc[(bib? [v any/c]) boolean?]{
|
||||
|
||||
Returns @scheme[#t] if @scheme[v] is a value produced by
|
||||
@scheme[make-bib] or @scheme[in-bib], @scheme[#f] otherwise.}
|
||||
Returns @racket[#t] if @racket[v] is a value produced by
|
||||
@racket[make-bib] or @racket[in-bib], @racket[#f] otherwise.}
|
||||
|
||||
|
||||
@defproc[(make-bib [#:title title any/c]
|
||||
|
@ -59,13 +59,13 @@ Returns @scheme[#t] if @scheme[v] is a value produced by
|
|||
bib?]{
|
||||
|
||||
Produces a value that represents a document to cite. Except for
|
||||
@scheme[is-book?] and @scheme[url], the arguments are used as
|
||||
elements, except that @scheme[#f] means that the information is not
|
||||
supplied. Functions like @scheme[proceedings-location],
|
||||
@scheme[author-name], and @scheme[authors] help produce elements in a
|
||||
@racket[is-book?] and @racket[url], the arguments are used as
|
||||
elements, except that @racket[#f] means that the information is not
|
||||
supplied. Functions like @racket[proceedings-location],
|
||||
@racket[author-name], and @racket[authors] help produce elements in a
|
||||
standard format.
|
||||
|
||||
An element produced by a function like @scheme[author-name] tracks
|
||||
An element produced by a function like @racket[author-name] tracks
|
||||
first, last names, and name suffixes separately, so that names can be
|
||||
ordered and rendered correctly. When a string is provided as an author
|
||||
name, the last non-empty sequence of alphabetic characters or
|
||||
|
@ -75,7 +75,7 @@ rest is treated as the first name.}
|
|||
@defproc[(in-bib [orig bib?] [where string?]) bib?]{
|
||||
|
||||
Extends a bib value so that the rendered citation is suffixed with
|
||||
@scheme[where], which might be a page or chapter number.}
|
||||
@racket[where], which might be a page or chapter number.}
|
||||
|
||||
@defproc[(proceedings-location [location any/c]
|
||||
[#:pages pages (or (list/c any/c any/c) #f) #f]
|
||||
|
@ -132,8 +132,8 @@ suffix (such as ``Jr.'').}
|
|||
@defproc[(authors [name any/c] ...) element?]{
|
||||
|
||||
Combines multiple author elements into one, so that it is rendered and
|
||||
alphabetized appropriately. If a @scheme[name] is a string, it is
|
||||
parsed in the same way as by @scheme[make-bib].}
|
||||
alphabetized appropriately. If a @racket[name] is a string, it is
|
||||
parsed in the same way as by @racket[make-bib].}
|
||||
|
||||
@defproc[(org-author-name [name any/c]) element?]{
|
||||
|
||||
|
@ -143,11 +143,11 @@ as a bib-value author.}
|
|||
@defproc[(other-authors) element?]{
|
||||
|
||||
Generates an element that is suitable for use as a ``others'' author.
|
||||
When combined with another author element via @scheme[authors], the
|
||||
one created by @scheme[other-authors] renders as ``et al.''}
|
||||
When combined with another author element via @racket[authors], the
|
||||
one created by @racket[other-authors] renders as ``et al.''}
|
||||
|
||||
@defproc[(editor [name name/c]) element?]{
|
||||
|
||||
Takes an author-name element and create one that represents the editor
|
||||
of a collection. If a @scheme[name] is a string, it is parsed in the
|
||||
same way as by @scheme[make-bib].}
|
||||
of a collection. If a @racket[name] is a string, it is parsed in the
|
||||
same way as by @racket[make-bib].}
|
||||
|
|
|
@ -17,19 +17,19 @@ block?]
|
|||
@defproc[(figure-here [tag string?] [caption content?] [pre-flow pre-flow?] ...) block?]
|
||||
)]{
|
||||
|
||||
Creates a figure. The given @scheme[tag] is for use with
|
||||
@scheme[figure-ref] or @scheme[Figure-ref]. The @scheme[caption] is an
|
||||
element. The @scheme[pre-flow] is decoded as a flow.
|
||||
Creates a figure. The given @racket[tag] is for use with
|
||||
@racket[figure-ref] or @racket[Figure-ref]. The @racket[caption] is an
|
||||
element. The @racket[pre-flow] is decoded as a flow.
|
||||
|
||||
For HTML output, the @scheme[figure] and @scheme[figure*] functions
|
||||
center the figure content, while @scheme[figure**] allows the content
|
||||
For HTML output, the @racket[figure] and @racket[figure*] functions
|
||||
center the figure content, while @racket[figure**] allows the content
|
||||
to be wider than the document body.
|
||||
For two-column Latex output, @scheme[figure*] and @scheme[figure**]
|
||||
For two-column Latex output, @racket[figure*] and @racket[figure**]
|
||||
generate a figure that spans columns.
|
||||
|
||||
For Latex output, @scheme[figure-here] generates a figure to be included at
|
||||
the position in the output text where the @scheme[figure-here] occurs
|
||||
in the source text. For HTML output, all @scheme[figure] variants
|
||||
For Latex output, @racket[figure-here] generates a figure to be included at
|
||||
the position in the output text where the @racket[figure-here] occurs
|
||||
in the source text. For HTML output, all @racket[figure] variants
|
||||
place the figure where the use appears in the source text.}
|
||||
|
||||
|
||||
|
@ -46,4 +46,4 @@ Generates a reference to a figure, capitalizing the word ``Figure''.}
|
|||
@defproc[(Figure-target [tag string?]) element?]{
|
||||
|
||||
Generates a new figure label. This function is normally not used
|
||||
directly, since it is used by @scheme[figure].}
|
||||
directly, since it is used by @racket[figure].}
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
@title[#:tag "gui-eval"]{Examples Using the GUI Toolbox}
|
||||
|
||||
@defmodule[scriblib/gui-eval]{The
|
||||
@schememodname[scriblib/gui-eval] library support example
|
||||
evaluations that use @schememodname[racket/gui] facilities (as opposed
|
||||
@racketmodname[scriblib/gui-eval] library support example
|
||||
evaluations that use @racketmodname[racket/gui] facilities (as opposed
|
||||
to just @racketmodname[racket/draw]) to generate text and image results.}
|
||||
|
||||
The trick is that @schememodname[racket/gui] is not generally
|
||||
The trick is that @racketmodname[racket/gui] is not generally
|
||||
available when rendering documentation, because it requires a GUI
|
||||
context. Text and image output is rendered to an image file when the
|
||||
@envvar{MREVAL} environment variable is set, so run the enclosing
|
||||
|
@ -33,13 +33,13 @@ generated image.
|
|||
#:eval+opts the-eval get-predicate? get-render
|
||||
get-get-width get-get-height
|
||||
datum ...))]
|
||||
@defform*[((gui-schemeblock+eval datum ...)
|
||||
(gui-schemeblock+eval
|
||||
@defform*[((gui-racketblock+eval datum ...)
|
||||
(gui-racketblock+eval
|
||||
#:eval+opts the-eval get-predicate? get-render
|
||||
get-get-width get-get-height
|
||||
datum ...))]
|
||||
@defform*[((gui-schememod+eval datum ...)
|
||||
(gui-schememod+eval
|
||||
@defform*[((gui-racketmod+eval datum ...)
|
||||
(gui-racketmod+eval
|
||||
#:eval+opts the-eval get-predicate? get-render
|
||||
get-get-width get-get-height
|
||||
datum ...))]
|
||||
|
@ -56,25 +56,25 @@ generated image.
|
|||
)]{
|
||||
|
||||
The first option of each of the above is
|
||||
like @scheme[interaction], etc., but actually evaluating the forms
|
||||
like @racket[interaction], etc., but actually evaluating the forms
|
||||
only when the @envvar{MREVAL} environment variable is set, and then in
|
||||
an evaluator that is initialized with @schememodname[racket/gui/base]
|
||||
and @schememodname[slideshow].
|
||||
an evaluator that is initialized with @racketmodname[racket/gui/base]
|
||||
and @racketmodname[slideshow].
|
||||
|
||||
The second option of each allows you to specify your own evaluator via
|
||||
the @scheme[the-eval] argument and then to specify four thunks that
|
||||
the @racket[the-eval] argument and then to specify four thunks that
|
||||
return functions for finding and rendering graphical objects:
|
||||
@itemize[
|
||||
@item{@scheme[get-predicate? : (-> (-> any/c boolean?))]
|
||||
@item{@racket[get-predicate? : (-> (-> any/c boolean?))]
|
||||
Determines if a value is a graphical object (and thus handled by the other operations)}
|
||||
@item{@scheme[get-render : (-> (-> any/c (is-a?/c dc<%>) number? number? void?))]
|
||||
Draws a graphical object (only called if the predicate returned @scheme[#t]; the first
|
||||
@item{@racket[get-render : (-> (-> any/c (is-a?/c dc<%>) number? number? void?))]
|
||||
Draws a graphical object (only called if the predicate returned @racket[#t]; the first
|
||||
argument will be the value for which the predicate holds).}
|
||||
@item{@scheme[get-get-width : (-> (-> any/c number?))]
|
||||
Gets the width of a graphical object (only called if the predicate returned @scheme[#t]; the first
|
||||
@item{@racket[get-get-width : (-> (-> any/c number?))]
|
||||
Gets the width of a graphical object (only called if the predicate returned @racket[#t]; the first
|
||||
argument will be the value for which the predicate holds).}
|
||||
@item{@scheme[get-get-height : (-> (-> any/c number?))]
|
||||
Gets the height of a graphical object (only called if the predicate returned @scheme[#t]; the first
|
||||
@item{@racket[get-get-height : (-> (-> any/c number?))]
|
||||
Gets the height of a graphical object (only called if the predicate returned @racket[#t]; the first
|
||||
argument will be the value for which the predicate holds).}
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user