somewhat rackety core docs
This commit is contained in:
parent
82eb64451d
commit
c7e723eef7
|
@ -19,14 +19,14 @@
|
|||
[ns (parameterize ([current-namespace this-ns]) ; ensures correct phase
|
||||
(make-empty-namespace))])
|
||||
(namespace-attach-module this-ns
|
||||
'scheme/base
|
||||
'racket/base
|
||||
ns)
|
||||
ns))
|
||||
|
||||
(define (make-base-namespace)
|
||||
(let ([ns (make-base-empty-namespace)])
|
||||
(parameterize ([current-namespace ns])
|
||||
(namespace-require 'scheme/base))
|
||||
(namespace-require 'racket/base))
|
||||
ns))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
|
2
collects/racket/signature/lang/reader.ss
Normal file
2
collects/racket/signature/lang/reader.ss
Normal file
|
@ -0,0 +1,2 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
racket/signature/lang
|
2
collects/racket/unit/lang/reader.ss
Normal file
2
collects/racket/unit/lang/reader.ss
Normal file
|
@ -0,0 +1,2 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
racket/unit/lang
|
|
@ -1,2 +1,2 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
scheme/signature/lang
|
||||
racket/signature/lang
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
#lang s-exp syntax/module-reader
|
||||
scheme/unit/lang
|
||||
racket/unit/lang
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
|
||||
(module eval scheme/base
|
||||
(module eval racket/base
|
||||
(require "manual.ss"
|
||||
"struct.ss"
|
||||
"scheme.ss"
|
||||
"decode.ss"
|
||||
scheme/file
|
||||
racket/file
|
||||
scheme/sandbox
|
||||
scheme/promise
|
||||
racket/promise
|
||||
mzlib/string
|
||||
(for-syntax scheme/base))
|
||||
(for-syntax racket/base))
|
||||
|
||||
(provide interaction
|
||||
interaction-eval
|
||||
interaction-eval-show
|
||||
schemeblock+eval
|
||||
schememod+eval
|
||||
racketblock+eval (rename-out [racketblock+eval schemeblock+eval])
|
||||
racketmod+eval (rename-out [racketmod+eval schememod+eval])
|
||||
def+int
|
||||
defs+int
|
||||
examples
|
||||
|
@ -38,8 +38,8 @@
|
|||
|
||||
(define maxlen 60)
|
||||
|
||||
(namespace-require 'scheme/base)
|
||||
(namespace-require '(for-syntax scheme/base))
|
||||
(namespace-require 'racket/base)
|
||||
(namespace-require '(for-syntax racket/base))
|
||||
|
||||
(define (literal-string style s)
|
||||
(let ([m (regexp-match #rx"^(.*)( +)(.*)$" s)])
|
||||
|
@ -325,31 +325,31 @@
|
|||
[(_ #:eval ev e) (do-interaction-eval-show ev (quote-expr e))]
|
||||
[(_ e) (do-interaction-eval-show #f (quote-expr e))]))
|
||||
|
||||
(define-syntax schemeinput*
|
||||
(define-syntax racketinput*
|
||||
(syntax-rules (eval:alts code:comment)
|
||||
[(_ (code:comment . rest)) (schemeblock (code:comment . rest))]
|
||||
[(_ (eval:alts a b)) (schemeinput* a)]
|
||||
[(_ e) (schemeinput e)]))
|
||||
[(_ (code:comment . rest)) (racketblock (code:comment . rest))]
|
||||
[(_ (eval:alts a b)) (racketinput* a)]
|
||||
[(_ e) (racketinput e)]))
|
||||
|
||||
(define-code schemeblock+line (to-paragraph/prefix (hspace 2)
|
||||
(define-code racketblock+line (to-paragraph/prefix (hspace 2)
|
||||
(hspace 2)
|
||||
(list " ")))
|
||||
|
||||
(define-syntax (schemedefinput* stx)
|
||||
(define-syntax (racketdefinput* stx)
|
||||
(syntax-case stx (define define-values define-struct)
|
||||
[(_ (define . rest))
|
||||
(syntax-case stx ()
|
||||
[(_ e) #'(schemeblock+line e)])]
|
||||
[(_ e) #'(racketblock+line e)])]
|
||||
[(_ (define-values . rest))
|
||||
(syntax-case stx ()
|
||||
[(_ e) #'(schemeblock+line e)])]
|
||||
[(_ e) #'(racketblock+line e)])]
|
||||
[(_ (define-struct . rest))
|
||||
(syntax-case stx ()
|
||||
[(_ e) #'(schemeblock+line e)])]
|
||||
[(_ e) #'(racketblock+line e)])]
|
||||
[(_ (code:line (define . rest) . rest2))
|
||||
(syntax-case stx ()
|
||||
[(_ e) #'(schemeblock+line e)])]
|
||||
[(_ e) #'(schemeinput* e)]))
|
||||
[(_ e) #'(racketblock+line e)])]
|
||||
[(_ e) #'(racketinput* e)]))
|
||||
|
||||
(define (do-titled-interaction ev t shows evals)
|
||||
(interleave t
|
||||
|
@ -358,41 +358,41 @@
|
|||
|
||||
(define-syntax titled-interaction
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev t schemeinput* e ...)
|
||||
(do-titled-interaction ev t (list (schemeinput* e) ...) (list (quote-expr e) ...))]
|
||||
[(_ t schemeinput* e ...)
|
||||
(titled-interaction #:eval (make-base-eval) t schemeinput* e ...)]))
|
||||
[(_ #:eval ev t racketinput* e ...)
|
||||
(do-titled-interaction ev t (list (racketinput* e) ...) (list (quote-expr e) ...))]
|
||||
[(_ t racketinput* e ...)
|
||||
(titled-interaction #:eval (make-base-eval) t racketinput* e ...)]))
|
||||
|
||||
(define-syntax interaction
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev e ...) (titled-interaction #:eval ev #f schemeinput* e ...)]
|
||||
[(_ e ...) (titled-interaction #f schemeinput* e ...)]))
|
||||
[(_ #:eval ev e ...) (titled-interaction #:eval ev #f racketinput* e ...)]
|
||||
[(_ e ...) (titled-interaction #f racketinput* e ...)]))
|
||||
|
||||
(define-syntax schemeblock+eval
|
||||
(define-syntax racketblock+eval
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev e ...)
|
||||
(let ([eva ev])
|
||||
(#%expression
|
||||
(begin (interaction-eval #:eval eva e) ...
|
||||
(schemeblock e ...))))]
|
||||
(racketblock e ...))))]
|
||||
[(_ e ...)
|
||||
(schemeblock+eval #:eval (make-base-eval) e ...)]))
|
||||
(racketblock+eval #:eval (make-base-eval) e ...)]))
|
||||
|
||||
(define-syntax schememod+eval
|
||||
(define-syntax racketmod+eval
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev name e ...)
|
||||
(let ([eva ev])
|
||||
(#%expression
|
||||
(begin (interaction-eval #:eval eva e) ...
|
||||
(schememod name e ...))))]
|
||||
(racketmod name e ...))))]
|
||||
[(_ name e ...)
|
||||
(schememod+eval #:eval (make-base-eval) name e ...)]))
|
||||
(racketmod+eval #:eval (make-base-eval) name e ...)]))
|
||||
|
||||
(define-syntax def+int
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev def e ...)
|
||||
(let ([eva ev])
|
||||
(column (list (schemeblock+eval #:eval eva def)
|
||||
(column (list (racketblock+eval #:eval eva def)
|
||||
blank-line
|
||||
(interaction #:eval eva e ...))))]
|
||||
[(_ def e ...)
|
||||
|
@ -402,7 +402,7 @@
|
|||
(syntax-rules ()
|
||||
[(_ #:eval ev [def ...] e ...)
|
||||
(let ([eva ev])
|
||||
(column (list (schemeblock+eval #:eval eva def ...)
|
||||
(column (list (racketblock+eval #:eval eva def ...)
|
||||
blank-line
|
||||
(interaction #:eval eva e ...))))]
|
||||
[(_ [def ...] e ...)
|
||||
|
@ -421,27 +421,27 @@
|
|||
(define-syntax examples
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev e ...)
|
||||
(titled-interaction #:eval ev (pick-example-title e ...) schemeinput* e ...)]
|
||||
(titled-interaction #:eval ev (pick-example-title e ...) racketinput* e ...)]
|
||||
[(_ e ...)
|
||||
(titled-interaction (pick-example-title e ...) schemeinput* e ...)]))
|
||||
(titled-interaction (pick-example-title e ...) racketinput* e ...)]))
|
||||
(define-syntax examples*
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev example-title e ...)
|
||||
(titled-interaction #:eval ev example-title schemeinput* e ...)]
|
||||
(titled-interaction #:eval ev example-title racketinput* e ...)]
|
||||
[(_ example-title e ...)
|
||||
(titled-interaction example-title schemeinput* e ...)]))
|
||||
(titled-interaction example-title racketinput* e ...)]))
|
||||
(define-syntax defexamples
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev e ...)
|
||||
(titled-interaction #:eval ev (pick-example-title e ...) schemedefinput* e ...)]
|
||||
(titled-interaction #:eval ev (pick-example-title e ...) racketdefinput* e ...)]
|
||||
[(_ e ...)
|
||||
(titled-interaction (pick-example-title e ...) schemedefinput* e ...)]))
|
||||
(titled-interaction (pick-example-title e ...) racketdefinput* e ...)]))
|
||||
(define-syntax defexamples*
|
||||
(syntax-rules ()
|
||||
[(_ #:eval ev example-title e ...)
|
||||
(titled-interaction #:eval ev example-title schemedefinput* e ...)]
|
||||
(titled-interaction #:eval ev example-title racketdefinput* e ...)]
|
||||
[(_ example-title e ...)
|
||||
(titled-interaction example-title schemedefinput* e ...)]))
|
||||
(titled-interaction example-title racketdefinput* e ...)]))
|
||||
|
||||
(define blank-line (make-paragraph (list 'nbsp)))
|
||||
|
||||
|
|
|
@ -1,38 +1,57 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
(require "../decode.ss"
|
||||
"../struct.ss"
|
||||
"../scheme.ss"
|
||||
"../search.ss"
|
||||
"../basic.ss"
|
||||
scheme/list
|
||||
racket/list
|
||||
"manual-utils.ss"
|
||||
"manual-style.ss"
|
||||
(for-syntax scheme/base)
|
||||
(for-label scheme/base))
|
||||
(for-syntax racket/base)
|
||||
(for-label racket/base))
|
||||
|
||||
(provide schemeblock SCHEMEBLOCK schemeblock/form
|
||||
schemeblock0 SCHEMEBLOCK0 schemeblock0/form
|
||||
schemeblockelem
|
||||
schemeinput
|
||||
schememod
|
||||
scheme SCHEME scheme/form schemeresult schemeid
|
||||
schememodname
|
||||
schememodlink indexed-scheme
|
||||
schemelink)
|
||||
(provide racketblock RACKETBLOCK racketblock/form
|
||||
racketblock0 RACKETBLOCK0 racketblock0/form
|
||||
racketblockelem
|
||||
racketinput
|
||||
racketmod
|
||||
racket RACKET racket/form racketresult racketid
|
||||
racketmodname
|
||||
racketmodlink indexed-racket
|
||||
racketlink
|
||||
|
||||
(define-code schemeblock0 to-paragraph)
|
||||
(define-code schemeblock (to-paragraph/prefix (hspace 2) (hspace 2) ""))
|
||||
(define-code SCHEMEBLOCK (to-paragraph/prefix (hspace 2) (hspace 2) "")
|
||||
(rename-out [racketblock schemeblock]
|
||||
[RACKETBLOCK SCHEMEBLOCK]
|
||||
[racketblock/form schemeblock/form]
|
||||
[racketblock0 schemeblock0]
|
||||
[RACKETBLOCK0 SCHEMEBLOCK0]
|
||||
[racketblock0/form schemeblock0/form]
|
||||
[racketblockelem schemeblockelem]
|
||||
[racketinput schemeinput]
|
||||
[racketmod schememod]
|
||||
[racket scheme]
|
||||
[RACKET SCHEME]
|
||||
[racket/form scheme/form]
|
||||
[racketresult schemeresult]
|
||||
[racketid schemeid]
|
||||
[racketmodname schememodname]
|
||||
[racketmodlink schememodlink]
|
||||
[indexed-racket indexed-scheme]
|
||||
[racketlink schemelink]))
|
||||
|
||||
(define-code racketblock0 to-paragraph)
|
||||
(define-code racketblock (to-paragraph/prefix (hspace 2) (hspace 2) ""))
|
||||
(define-code RACKETBLOCK (to-paragraph/prefix (hspace 2) (hspace 2) "")
|
||||
UNSYNTAX)
|
||||
(define-code SCHEMEBLOCK0 to-paragraph UNSYNTAX)
|
||||
(define-code RACKETBLOCK0 to-paragraph UNSYNTAX)
|
||||
(define interaction-prompt (make-element 'tt (list "> " )))
|
||||
(define-code schemeinput
|
||||
(define-code racketinput
|
||||
(to-paragraph/prefix
|
||||
(make-element #f (list (hspace 2) interaction-prompt))
|
||||
(hspace 4)
|
||||
""))
|
||||
|
||||
(define-syntax (schememod stx)
|
||||
(define-syntax (racketmod stx)
|
||||
(syntax-case stx ()
|
||||
[(_ #:file filename lang rest ...)
|
||||
(with-syntax ([modtag (datum->syntax
|
||||
|
@ -45,7 +64,7 @@
|
|||
`(as-modname-link
|
||||
',#'lang
|
||||
(to-element ',#'lang))
|
||||
#'(scheme lang)))))
|
||||
#'(racket lang)))))
|
||||
#'lang)]
|
||||
[(file ...)
|
||||
(if (syntax-e #'filename)
|
||||
|
@ -55,9 +74,9 @@
|
|||
`(code:comment (unsyntax (t "In \"" ,(syntax-e #'filename) "\":")))
|
||||
#'filename))
|
||||
null)])
|
||||
(syntax/loc stx (schemeblock file ... modtag rest ...)))]
|
||||
(syntax/loc stx (racketblock file ... modtag rest ...)))]
|
||||
[(_ lang rest ...)
|
||||
(syntax/loc stx (schememod #:file #f lang rest ...))]))
|
||||
(syntax/loc stx (racketmod #:file #f lang rest ...))]))
|
||||
|
||||
(define (to-element/result s)
|
||||
(make-element result-color (list (to-element/no-color s))))
|
||||
|
@ -91,25 +110,25 @@
|
|||
(make-shaped-parens s val)
|
||||
s))
|
||||
|
||||
(define-code schemeblockelem to-element)
|
||||
(define-code racketblockelem to-element)
|
||||
|
||||
(define-code scheme to-element unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code SCHEME to-element UNSYNTAX keep-s-expr add-sq-prop)
|
||||
(define-code schemeresult to-element/result unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code schemeid to-element/id unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code *schememodname to-element unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code racket to-element unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code RACKET to-element UNSYNTAX keep-s-expr add-sq-prop)
|
||||
(define-code racketresult to-element/result unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code racketid to-element/id unsyntax keep-s-expr add-sq-prop)
|
||||
(define-code *racketmodname to-element unsyntax keep-s-expr add-sq-prop)
|
||||
|
||||
(define-syntax schememodname
|
||||
(define-syntax racketmodname
|
||||
(syntax-rules (unsyntax)
|
||||
[(schememodname #,n)
|
||||
[(racketmodname #,n)
|
||||
(let ([sym n])
|
||||
(as-modname-link sym (to-element sym)))]
|
||||
[(schememodname n)
|
||||
(as-modname-link 'n (*schememodname n))]))
|
||||
[(racketmodname n)
|
||||
(as-modname-link 'n (*racketmodname n))]))
|
||||
|
||||
(define-syntax schememodlink
|
||||
(define-syntax racketmodlink
|
||||
(syntax-rules (unsyntax)
|
||||
[(schememodlink n content ...)
|
||||
[(racketmodlink n content ...)
|
||||
(*as-modname-link 'n (elem #:style #f content ...))]))
|
||||
|
||||
(define (as-modname-link s e)
|
||||
|
@ -122,10 +141,10 @@
|
|||
(list e)
|
||||
`(mod-path ,(format "~s" s))))
|
||||
|
||||
(define-syntax-rule (indexed-scheme x)
|
||||
(add-scheme-index 'x (scheme x)))
|
||||
(define-syntax-rule (indexed-racket x)
|
||||
(add-racket-index 'x (racket x)))
|
||||
|
||||
(define (add-scheme-index s e)
|
||||
(define (add-racket-index s e)
|
||||
(let ([k (cond [(and (pair? s) (eq? (car s) 'quote)) (format "~s" (cadr s))]
|
||||
[(string? s) s]
|
||||
[else (format "~s" s)])])
|
||||
|
@ -139,11 +158,11 @@
|
|||
#'(let ([ellipses #f])
|
||||
(base a)))])))
|
||||
|
||||
(define-/form schemeblock0/form schemeblock0)
|
||||
(define-/form schemeblock/form schemeblock)
|
||||
(define-/form scheme/form scheme)
|
||||
(define-/form racketblock0/form racketblock0)
|
||||
(define-/form racketblock/form racketblock)
|
||||
(define-/form racket/form racket)
|
||||
|
||||
(define (*schemelink stx-id id . s)
|
||||
(define (*racketlink stx-id id . s)
|
||||
(let ([content (decode-content s)])
|
||||
(make-delayed-element
|
||||
(lambda (r p ri)
|
||||
|
@ -151,11 +170,11 @@
|
|||
(make-link-element
|
||||
#f
|
||||
content
|
||||
(or (find-scheme-tag p ri stx-id #f)
|
||||
(or (find-racket-tag p ri stx-id #f)
|
||||
`(undef ,(format "--UNDEFINED:~a--" (syntax-e stx-id)))))))
|
||||
(lambda () content)
|
||||
(lambda () content))))
|
||||
|
||||
(define-syntax-rule (schemelink id . content)
|
||||
(*schemelink (quote-syntax id) 'id . content))
|
||||
(define-syntax-rule (racketlink id . content)
|
||||
(*racketlink (quote-syntax id) 'id . content))
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
(require "../decode.ss"
|
||||
"../struct.ss"
|
||||
"../base.ss"
|
||||
|
@ -7,9 +7,9 @@
|
|||
(only-in "../core.ss" make-style plain)
|
||||
"manual-utils.ss"
|
||||
"on-demand.ss"
|
||||
scheme/list
|
||||
scheme/contract
|
||||
scheme/string)
|
||||
racket/list
|
||||
racket/contract
|
||||
racket/string)
|
||||
|
||||
(provide (rename-out [hyperlink link])
|
||||
(rename-out [other-doc other-manual])
|
||||
|
@ -23,12 +23,26 @@
|
|||
(() () #:rest (listof pre-content?) . ->* . element?))
|
||||
(define-syntax-rule (provide-styling id ...)
|
||||
(provide/contract [id styling-f/c] ...))
|
||||
(provide-styling schememodfont schemeoutput
|
||||
schemeerror schemefont schemevalfont schemeresultfont schemeidfont schemevarfont
|
||||
schemeparenfont schemekeywordfont schememetafont
|
||||
(provide-styling racketmodfont racketoutput
|
||||
racketerror racketfont racketvalfont racketresultfont racketidfont racketvarfont
|
||||
racketparenfont racketkeywordfont racketmetafont
|
||||
onscreen defterm filepath exec envvar Flag DFlag PFlag DPFlag math
|
||||
procedure
|
||||
indexed-file indexed-envvar idefterm pidefterm)
|
||||
(define-syntax-rule (provide-scheme-styling [rid sid] ...)
|
||||
(provide/contract [rename rid sid styling-f/c] ...))
|
||||
(provide-scheme-styling [racketmodfont schememodfont]
|
||||
[racketoutput schemeoutput]
|
||||
[racketerror schemeerror]
|
||||
[racketfont schemefont]
|
||||
[racketvalfont schemevalfont]
|
||||
[racketresultfont schemeresultfont]
|
||||
[racketidfont schemeidfont]
|
||||
[racketvarfont schemevarfont]
|
||||
[racketparenfont schemeparenfont]
|
||||
[racketkeywordfont schemekeywordfont]
|
||||
[racketmetafont schememetafont])
|
||||
|
||||
(provide void-const
|
||||
undefined-const)
|
||||
(provide/contract
|
||||
|
@ -68,23 +82,23 @@
|
|||
(define (idefterm . str)
|
||||
(let ([c (decode-content str)])
|
||||
(make-element 'italic c)))
|
||||
(define (schemefont . str)
|
||||
(define (racketfont . str)
|
||||
(apply tt str))
|
||||
(define (schemevalfont . str)
|
||||
(define (racketvalfont . str)
|
||||
(make-element value-color (decode-content str)))
|
||||
(define (schemeresultfont . str)
|
||||
(define (racketresultfont . str)
|
||||
(make-element result-color (decode-content str)))
|
||||
(define (schemeidfont . str)
|
||||
(define (racketidfont . str)
|
||||
(make-element symbol-color (decode-content str)))
|
||||
(define (schemevarfont . str)
|
||||
(define (racketvarfont . str)
|
||||
(make-element variable-color (decode-content str)))
|
||||
(define (schemeparenfont . str)
|
||||
(define (racketparenfont . str)
|
||||
(make-element paren-color (decode-content str)))
|
||||
(define (schememetafont . str)
|
||||
(define (racketmetafont . str)
|
||||
(make-element meta-color (decode-content str)))
|
||||
(define (schememodfont . str)
|
||||
(define (racketmodfont . str)
|
||||
(make-element module-color (decode-content str)))
|
||||
(define (schemekeywordfont . str)
|
||||
(define (racketkeywordfont . str)
|
||||
(make-element keyword-color (decode-content str)))
|
||||
(define (filepath . str)
|
||||
(make-element 'tt (append (list "\"") (decode-content str) (list "\""))))
|
||||
|
@ -124,9 +138,9 @@
|
|||
(define (procedure . str)
|
||||
(make-element result-color `("#<procedure:" ,@(decode-content str) ">")))
|
||||
|
||||
(define (schemeoutput . str)
|
||||
(define (racketoutput . str)
|
||||
(make-element output-color (decode-content str)))
|
||||
(define (schemeerror . str)
|
||||
(define (racketerror . str)
|
||||
(make-element error-color (decode-content str)))
|
||||
|
||||
(define (t . str)
|
||||
|
@ -150,13 +164,13 @@
|
|||
(define (hash-lang)
|
||||
(make-link-element
|
||||
module-link-color
|
||||
(list (schememodfont "#lang"))
|
||||
(list (racketmodfont "#lang"))
|
||||
`(part ,(doc-prefix '(lib "scribblings/guide/guide.scrbl") "hash-lang"))))
|
||||
|
||||
(define-on-demand void-const
|
||||
(schemeresultfont "#<void>"))
|
||||
(racketresultfont "#<void>"))
|
||||
(define-on-demand undefined-const
|
||||
(schemeresultfont "#<undefined>"))
|
||||
(racketresultfont "#<undefined>"))
|
||||
|
||||
(define (link url
|
||||
#:underline? [underline? #t]
|
||||
|
|
|
@ -667,7 +667,8 @@
|
|||
(null? s)
|
||||
(hash? s)
|
||||
(graph-defn? s)
|
||||
(graph-reference? s))
|
||||
(graph-reference? s)
|
||||
(struct-proxy? s))
|
||||
(gen-typeset c multi-line? prefix1 prefix suffix color? qq?)
|
||||
(typeset-atom c
|
||||
(letrec ([mk
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
(module search scheme/base
|
||||
(module search racket/base
|
||||
(require "struct.ss"
|
||||
"basic.ss"
|
||||
setup/main-collects
|
||||
syntax/modcode)
|
||||
|
||||
(provide find-scheme-tag)
|
||||
(provide find-racket-tag
|
||||
(rename-out [find-racket-tag find-scheme-tag]))
|
||||
|
||||
(define module-info-cache (make-hasheq))
|
||||
|
||||
|
@ -21,7 +22,7 @@
|
|||
(with-handlers* ([exn:fail? (lambda (exn) (fail-thunk))])
|
||||
(thunk)))
|
||||
|
||||
(define (find-scheme-tag part ri stx/binding phase-level)
|
||||
(define (find-racket-tag part ri stx/binding phase-level)
|
||||
;; The phase-level argument is used only when `stx/binding'
|
||||
;; is an identifier.
|
||||
;;
|
||||
|
@ -169,7 +170,7 @@
|
|||
;; have changed in inconsistent ways. So just say #f
|
||||
;; for now.
|
||||
#;
|
||||
(error 'find-scheme-tag
|
||||
(error 'find-racket-tag
|
||||
"dead end when looking for binding source: ~e"
|
||||
id)
|
||||
(loop queue rqueue need-result?)))))
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
#lang racket/base
|
||||
|
||||
(module urls mzscheme
|
||||
(provide (all-defined))
|
||||
(provide (all-defined-out)
|
||||
(rename-out [url:drracket url:drscheme]
|
||||
[url:download-drracket url:download-drscheme]))
|
||||
|
||||
(define url:drscheme "http://www.drscheme.org/")
|
||||
(define url:download-drscheme "http://download.plt-scheme.org/drscheme/")
|
||||
(define url:drracket "http://racket-lang.org/")
|
||||
(define url:download-drracket "http://racket-lang.org/")
|
||||
|
||||
(define url:planet "http://planet.plt-scheme.org/"))
|
||||
(define url:planet "http://planet.plt-scheme.org/")
|
||||
|
|
|
@ -5,10 +5,9 @@
|
|||
|
||||
@author["Eli Barzilay"]
|
||||
|
||||
@defmodule[scheme/foreign #:use-sources ('#%foreign
|
||||
racket/unsafe/ffi)]
|
||||
@defmodule[racket/unsafe/ffi #:use-sources ('#%foreign)]
|
||||
|
||||
The @schememodname[scheme/foreign] library enables the direct use of
|
||||
The @schememodname[racket/unsafe/ffi] library enables the direct use of
|
||||
C-based APIs within Scheme programs---without writing any new C
|
||||
code. From the Scheme perspective, functions and data with a C-based
|
||||
API are @idefterm{foreign}, hence the term @defterm{foreign
|
||||
|
@ -16,10 +15,6 @@ interface}. Furthermore, since most APIs consist mostly of functions,
|
|||
the foreign interface is sometimes called a @defterm{foreign function
|
||||
interface}, abbreviated @deftech{FFI}.
|
||||
|
||||
@bold{Important:} Many of the bindings documented here (the ones in
|
||||
sections with titles starting ``Unsafe'') are available only after an
|
||||
@scheme[(unsafe!)] declaration in the importing module.
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
@include-section["intro.scrbl"]
|
||||
|
|
|
@ -12,23 +12,13 @@ information in @|InsideMzScheme|, which defines how PLT Scheme
|
|||
interacts with C APIs in general.
|
||||
|
||||
Since using the FFI entails many safety concerns that Scheme
|
||||
programmers can normally ignore, merely importing
|
||||
@schememodname[scheme/foreign] with @scheme[(require scheme/foreign)]
|
||||
does not import all of the FFI functionality. Only safe functionality
|
||||
is immediately imported. For example, @scheme[ptr-equal?] can never
|
||||
cause memory corruption or an invalid memory access, so it is
|
||||
immediately available on import.
|
||||
|
||||
Use @scheme[(@#,indexed-scheme[unsafe!])] at the top-level of a
|
||||
module that imports @schememodname[scheme/foreign] to make unsafe
|
||||
features accessible. (For additional safety, the @scheme[unsafe!] is
|
||||
itself protected; see @secref[#:doc '(lib
|
||||
"scribblings/reference/reference.scrbl") "modprotect"].) Using this
|
||||
macro should be considered as a declaration that your code is itself
|
||||
unsafe, therefore can lead to serious problems in case of bugs: it is
|
||||
your responsibility to provide a safe interface. Bindings that become
|
||||
available only via @scheme[unsafe!] are documented in this manual in
|
||||
sections with titles starting ``Unsafe.''
|
||||
programmers can normally ignore, the library name includes
|
||||
@schemeidfont{unsafe}. Importing the library macro should be
|
||||
considered as a declaration that your code is itself unsafe, therefore
|
||||
can lead to serious problems in case of bugs: it is your
|
||||
responsibility to provide a safe interface. If your library provides
|
||||
an unsafe interface, then it should have @schemeidfont{unsafe} in its
|
||||
name, too.
|
||||
|
||||
For examples of common FFI usage patterns, see the defined interfaces
|
||||
in the @filepath{ffi} collection.
|
||||
|
|
|
@ -3,28 +3,3 @@
|
|||
|
||||
@title{Macros for Unsafety}
|
||||
|
||||
@defform[(unsafe!)]{
|
||||
|
||||
Makes most of the bindings documented in this module available. See
|
||||
@secref["intro"] for information on why this declaration is required.}
|
||||
|
||||
|
||||
@defform/subs[#:literals (unsafe rename-out)
|
||||
(provide* provide-star-spec ...)
|
||||
([provide-star-spec (unsafe id)
|
||||
(unsafe (rename-out [id external-id]))
|
||||
provide-spec])]{
|
||||
|
||||
Like @scheme[provide], but @scheme[id]s under @scheme[unsafe] are not
|
||||
actually provided. Instead, they are collected for introduction into
|
||||
an importing module via a macro created by @scheme[define-unsafer].
|
||||
|
||||
Providing users with unsafe operations without using this facility
|
||||
should be considered a bug in your code.}
|
||||
|
||||
@defform[(define-unsafer id)]{
|
||||
|
||||
Cooperates with @scheme[provide*] to define @scheme[id] as a
|
||||
@scheme[unsafe!]-like form that introduces definitions for each
|
||||
binding provided as @scheme[unsafe]. The @scheme[define-unsafer] form
|
||||
must occur after all the @scheme[provide*] forms to which it refers.}
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(require scribble/manual
|
||||
scribble/struct
|
||||
scribble/decode
|
||||
(only-in "../inside/utils.ss" cpp)
|
||||
(for-syntax scheme/base)
|
||||
(for-label scheme/base
|
||||
scheme/contract
|
||||
(except-in "unsafe-foreign.ss" ->)))
|
||||
(for-syntax racket/base)
|
||||
(for-label racket/base
|
||||
racket/contract
|
||||
(except-in racket/unsafe/ffi ->)))
|
||||
|
||||
(provide cpp
|
||||
InsideMzScheme
|
||||
(all-from-out scribble/manual)
|
||||
(for-label (all-from-out scheme/base
|
||||
scheme/contract
|
||||
"unsafe-foreign.ss")))
|
||||
(for-label (all-from-out racket/base
|
||||
racket/contract
|
||||
racket/unsafe/ffi)))
|
||||
|
||||
|
||||
(define InsideMzScheme
|
||||
|
|
|
@ -1,21 +1,21 @@
|
|||
#lang scribble/doc
|
||||
@(require "common.ss"
|
||||
(for-label scheme/gui/dynamic))
|
||||
(for-label racket/gui/dynamic))
|
||||
|
||||
@title{Dynamic Loading}
|
||||
|
||||
@defmodule[scheme/gui/dynamic]{The @schememodname[scheme/gui/dynamic]
|
||||
library provides functions for dynamically accessing the PLT Scheme
|
||||
GUI toolbox, instead of directly requiring @scheme[scheme/gui] or
|
||||
@scheme[scheme/gui/base].}
|
||||
@defmodule[racket/gui/dynamic]{The @racketmodname[racket/gui/dynamic]
|
||||
library provides functions for dynamically accessing the PLT Racket
|
||||
GUI toolbox, instead of directly requiring @racket[racket/gui] or
|
||||
@racket[racket/gui/base].}
|
||||
|
||||
@defproc[(gui-available?) boolean?]{
|
||||
|
||||
Returns @scheme[#t] if dynamic access to the GUI bindings are
|
||||
Returns @racket[#t] if dynamic access to the GUI bindings are
|
||||
available---that is, that the program is being run as a
|
||||
@exec{mred}-based application, as opposed to a pure
|
||||
@exec{mzscheme}-based application, and that GUI modules are attached
|
||||
to the namespace in which @scheme[scheme/gui/dynamic] was
|
||||
@exec{mzracket}-based application, and that GUI modules are attached
|
||||
to the namespace in which @racket[racket/gui/dynamic] was
|
||||
instantiated.
|
||||
|
||||
This predicate can be used in code that optionally uses GUI elements
|
||||
|
@ -24,5 +24,5 @@ when they are available.}
|
|||
|
||||
@defproc[(gui-dynamic-require [sym symbol?]) any]{
|
||||
|
||||
Like @scheme[dynamic-require], but specifically to access exports of
|
||||
@scheme[scheme/gui/base].}
|
||||
Like @racket[dynamic-require], but specifically to access exports of
|
||||
@racket[racket/gui/base].}
|
||||
|
|
|
@ -5,21 +5,21 @@
|
|||
|
||||
@author["Matthew Flatt" "Robert Bruce Findler" "John Clements"]
|
||||
|
||||
@declare-exporting[scheme/gui/base scheme/gui #:use-sources (mred)]
|
||||
@declare-exporting[racket/gui/base racket/gui #:use-sources (mred)]
|
||||
|
||||
This reference manual describes the GUI toolbox that is part of PLT
|
||||
Scheme and whose core is implemented by the MrEd executable.
|
||||
Racket and whose core is implemented by the MrEd executable.
|
||||
|
||||
@defmodule*/no-declare[(scheme/gui/base)]{The
|
||||
@schememodname[scheme/gui/base] library provides all of the class,
|
||||
@defmodule*/no-declare[(racket/gui/base)]{The
|
||||
@racketmodname[racket/gui/base] library provides all of the class,
|
||||
interface, and procedure bindings defined in this manual. At run time,
|
||||
this library needs primitive graphics support that the MrEd executable
|
||||
provides; this library cannot run in MzScheme.}
|
||||
provides; this library cannot run in MzRacket.}
|
||||
|
||||
@defmodulelang*/no-declare[(scheme/gui)]{The
|
||||
@schememodname[scheme/gui] language combines all bindings of the
|
||||
@schememodname[scheme] language and the
|
||||
@schememodname[scheme/gui/base] modules.}
|
||||
@defmodulelang*/no-declare[(racket/gui)]{The
|
||||
@racketmodname[racket/gui] language combines all bindings of the
|
||||
@racketmodname[racket] language and the
|
||||
@racketmodname[racket/gui/base] modules.}
|
||||
|
||||
|
||||
@table-of-contents[]
|
||||
|
|
|
@ -3,88 +3,88 @@
|
|||
((2) 0 () 0 () () (c begin c "art gallery"))
|
||||
((2) 0 () 0 () () "art gallery")
|
||||
((2) 0 () 0 () () (c circle c 10))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img0") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img0") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c rectangle c 10 c 20))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img1") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img1") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c circle c 10 c 20))
|
||||
((2) 1 (((lib "scriblib/private/gui-eval-exn.ss") . deserialize-info:gui-exn-v0)) 0 () () (0 "procedure circle: expects 1 argument, given 2: 10 20"))
|
||||
((2) 1 (((lib "scriblib/private/gui-eval-exn.rkt") . deserialize-info:gui-exn-v0)) 0 () () (0 "procedure circle: expects 1 argument, given 2: 10 20"))
|
||||
((2) 0 () 0 () () (c hc-append c (c circle c 10) c (c rectangle c 10 c 20)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img2") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img2") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c c c (c circle c 10)))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c define c r c (c rectangle c 10 c 20)))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () r)
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img3") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img3") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c hc-append c c c r))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img4") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img4") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c hc-append c 20 c c c r c c))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img5") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img5") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c (c square c n) c (c filled-rectangle c n c n)))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c square c 10))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img6") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img6") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c (c four c p) c (c define c two-p c (c hc-append c p c p)) c (c vc-append c two-p c two-p)))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c four c (c circle c 10)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img7") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img7") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c (c checker c p1 c p2) c (c let c (c (c p12 c (c hc-append c p1 c p2)) c (c p21 c (c hc-append c p2 c p1))) c (c vc-append c p12 c p21))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c checker c (c colorize c (c square c 10) c "red") c (c colorize c (c square c 10) c "black")))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img8") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img8") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c (c checkerboard c p) c (c let* c (c (c rp c (c colorize c p c "red")) c (c bp c (c colorize c p c "black")) c (c c c (c checker c rp c bp)) c (c c4 c (c four c c))) c (c four c c4))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c checkerboard c (c square c 10)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img9") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img9") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () circle)
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:element-v0)) 0 () () (0 #f (c (u . "#<procedure:circle>"))))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:element-v0)) 0 () () (0 #f (c (u . "#<procedure:circle>"))))
|
||||
((2) 0 () 0 () () (c define c (c series c mk) c (c hc-append c 4 c (c mk c 5) c (c mk c 10) c (c mk c 20))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c series c circle))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img10") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img10") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c series c square))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img11") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img11") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c series c (c lambda c (c size) c (c checkerboard c (c square c size)))))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img12") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img12") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c (c rgb-series c mk) c (c vc-append c (c series c (c lambda c (c sz) c (c colorize c (c mk c sz) c "red"))) c (c series c (c lambda c (c sz) c (c colorize c (c mk c sz) c "green"))) c (c series c (c lambda c (c sz) c (c colorize c (c mk c sz) c "blue"))))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c rgb-series c circle))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img13") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img13") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c rgb-series c square))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img14") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img14") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define c (c rgb-maker c mk) c (c lambda c (c sz) c (c vc-append c (c colorize c (c mk c sz) c "red") c (c colorize c (c mk c sz) c "green") c (c colorize c (c mk c sz) c "blue")))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c series c (c rgb-maker c circle)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img15") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img15") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c series c (c rgb-maker c square)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img16") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img16") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c list c "red" c "green" c "blue"))
|
||||
((2) 0 () 0 () () (c "red" c "green" c "blue"))
|
||||
((2) 0 () 0 () () (c list c (c circle c 10) c (c square c 10)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 2 ("[image]" (c ".pdf" c ".png")) () (c (0 #f (c (? . 0)) (u . "images/img17") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img18") (? . 1) 1.0)))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 2 ("[image]" (c ".pdf" c ".png")) () (c (0 #f (c (? . 0)) (u . "images/img17") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img18") (? . 1) 1.0)))
|
||||
((2) 0 () 0 () () (c define c (c rainbow c p) c (c map c (c lambda c (c color) c (c colorize c p c color)) c (c list c "red" c "orange" c "yellow" c "green" c "blue" c "purple"))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c rainbow c (c square c 5)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 2 ("[image]" (c ".pdf" c ".png")) () (c (0 #f (c (? . 0)) (u . "images/img19") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img20") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img21") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img22") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img23") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img24") (? . 1) 1.0)))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 2 ("[image]" (c ".pdf" c ".png")) () (c (0 #f (c (? . 0)) (u . "images/img19") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img20") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img21") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img22") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img23") (? . 1) 1.0) c (0 #f (c (? . 0)) (u . "images/img24") (? . 1) 1.0)))
|
||||
((2) 0 () 0 () () (c apply c vc-append c (c rainbow c (c square c 5))))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img25") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img25") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c require c slideshow/flash))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c filled-flash c 40 c 30))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img26") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c require c (c planet c "random.ss" c (c "schematics" c "random.plt" c 1 c 0))))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img26") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c require c (c planet c "random.rkt" c (c "schematics" c "random.plt" c 1 c 0))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c random-gaussian))
|
||||
((2) 0 () 0 () () 0.7386912134436788)
|
||||
((2) 0 () 0 () () (c require c slideshow/code))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c code c (c circle c 10)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img27") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img27") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c define-syntax c pict+code c (c syntax-rules c () c (c (c pict+code c expr) c (c hc-append c 10 c expr c (c code c expr))))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c pict+code c (c circle c 10)))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img28") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c require c scheme/class c scheme/gui/base))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img28") (c ".pdf" c ".png") 1.0))
|
||||
((2) 0 () 0 () () (c require c racket/class c racket/gui/base))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c define c f c (c new c frame% c (c label c "My Art") c (c width c 300) c (c height c 300) c (c alignment c (c quote c (c center c center))))))
|
||||
((2) 0 () 0 () () (void))
|
||||
|
@ -95,8 +95,8 @@
|
|||
((2) 0 () 0 () () (c define c (c add-drawing c p) c (c let c (c (c drawer c (c make-pict-drawer c p))) c (c new c canvas% c (c parent c f) c (c style c (c quote c (c border))) c (c paint-callback c (c lambda c (c self c dc) c (c drawer c dc c 0 c 0)))))))
|
||||
((2) 0 () 0 () () (void))
|
||||
((2) 0 () 0 () () (c add-drawing c (c pict+code c (c circle c 10))))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:element-v0)) 0 () () (0 #f (c (u . "#(struct:object:canvas% ...)"))))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:element-v0)) 0 () () (0 #f (c (u . "#(struct:object:canvas% ...)"))))
|
||||
((2) 0 () 0 () () (c add-drawing c (c colorize c (c filled-flash c 50 c 30) c "yellow")))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:element-v0)) 0 () () (0 #f (c (u . "#(struct:object:canvas% ...)"))))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:element-v0)) 0 () () (0 #f (c (u . "#(struct:object:canvas% ...)"))))
|
||||
((2) 0 () 0 () () (c scale c (c bitmap c (c build-path c (c collection-path c "scribblings/quick") c "art.png")) c 0.5))
|
||||
((2) 1 (((lib "scribble/core.ss") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img29") (c ".pdf" c ".png") 1.0))
|
||||
((2) 1 (((lib "scribble/core.rkt") . deserialize-info:image-element-v0)) 0 () () (0 #f (c "[image]") (u . "images/img29") (c ".pdf" c ".png") 1.0))
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -42,10 +42,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f22d160f-af3b-11e9-0000-34a7f4bf94ee' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f22d160f-af3b-11e9-0000-34a7f4bf94ee' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:26:00-06:00' xap:CreateDate='2009-07-22T18:26:00-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f22d160f-af3b-11e9-0000-34a7f4bf94ee' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f22d160f-af3b-11e9-0000-34a7f4bf94ee'/>
|
||||
<rdf:Description rdf:about='f22d160f-af3b-11e9-0000-34a7f4bf94ee' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9bd8d72d-8665-11ea-0000-34a7f4bf94ee' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9bd8d72d-8665-11ea-0000-34a7f4bf94ee' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:54-06:00' xap:CreateDate='2010-04-22T13:55:54-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9bd8d72d-8665-11ea-0000-34a7f4bf94ee' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9bd8d72d-8665-11ea-0000-34a7f4bf94ee'/>
|
||||
<rdf:Description rdf:about='9bd8d72d-8665-11ea-0000-34a7f4bf94ee' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -55,8 +55,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182600-06'00')
|
||||
/ModDate(D:20090722182600-06'00')
|
||||
/CreationDate(D:20100422135554-06'00')
|
||||
/ModDate(D:20100422135554-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -73,7 +73,7 @@ xref
|
|||
0000000640 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<359940CD83EE8F3FC014C34CE1255CDE><359940CD83EE8F3FC014C34CE1255CDE>]
|
||||
/ID [<773F739C40C01D398B1ACA4FA8323A87><773F739C40C01D398B1ACA4FA8323A87>]
|
||||
>>
|
||||
startxref
|
||||
2278
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -42,10 +42,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f2c5ac8f-af3b-11e9-0000-de937bc06cc7' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f2c5ac8f-af3b-11e9-0000-de937bc06cc7' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:26:01-06:00' xap:CreateDate='2009-07-22T18:26:01-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f2c5ac8f-af3b-11e9-0000-de937bc06cc7' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f2c5ac8f-af3b-11e9-0000-de937bc06cc7'/>
|
||||
<rdf:Description rdf:about='f2c5ac8f-af3b-11e9-0000-de937bc06cc7' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-de937bc06cc7' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-de937bc06cc7' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:55-06:00' xap:CreateDate='2010-04-22T13:55:55-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-de937bc06cc7' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9c716dad-8665-11ea-0000-de937bc06cc7'/>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-de937bc06cc7' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -55,8 +55,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182601-06'00')
|
||||
/ModDate(D:20090722182601-06'00')
|
||||
/CreationDate(D:20100422135555-06'00')
|
||||
/ModDate(D:20100422135555-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -73,7 +73,7 @@ xref
|
|||
0000000577 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<B544940615DB98AEC7D1DC63F54A451E><B544940615DB98AEC7D1DC63F54A451E>]
|
||||
/ID [<CB114AF944A7F85D520FBB25E1E9B5DD><CB114AF944A7F85D520FBB25E1E9B5DD>]
|
||||
>>
|
||||
startxref
|
||||
2215
|
||||
|
|
Binary file not shown.
|
@ -42,10 +42,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f35e430f-af3b-11e9-0000-11040068121c' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f35e430f-af3b-11e9-0000-11040068121c' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:26:02-06:00' xap:CreateDate='2009-07-22T18:26:02-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f35e430f-af3b-11e9-0000-11040068121c' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f35e430f-af3b-11e9-0000-11040068121c'/>
|
||||
<rdf:Description rdf:about='f35e430f-af3b-11e9-0000-11040068121c' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-11040068121c' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-11040068121c' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:55-06:00' xap:CreateDate='2010-04-22T13:55:55-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-11040068121c' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9c716dad-8665-11ea-0000-11040068121c'/>
|
||||
<rdf:Description rdf:about='9c716dad-8665-11ea-0000-11040068121c' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -55,8 +55,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182602-06'00')
|
||||
/ModDate(D:20090722182602-06'00')
|
||||
/CreationDate(D:20100422135555-06'00')
|
||||
/ModDate(D:20100422135555-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -73,7 +73,7 @@ xref
|
|||
0000000588 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<3F728FBF71FC3EE42151B158C78C6E47><3F728FBF71FC3EE42151B158C78C6E47>]
|
||||
/ID [<2D22C5E6138860AE600CF56ED7C7E964><2D22C5E6138860AE600CF56ED7C7E964>]
|
||||
>>
|
||||
startxref
|
||||
2226
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -44,10 +44,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f0fbe90f-af3b-11e9-0000-2bb4b895d559' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f0fbe90f-af3b-11e9-0000-2bb4b895d559' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:25:58-06:00' xap:CreateDate='2009-07-22T18:25:58-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f0fbe90f-af3b-11e9-0000-2bb4b895d559' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f0fbe90f-af3b-11e9-0000-2bb4b895d559'/>
|
||||
<rdf:Description rdf:about='f0fbe90f-af3b-11e9-0000-2bb4b895d559' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:53-06:00' xap:CreateDate='2010-04-22T13:55:53-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9b4040ad-8665-11ea-0000-2bb4b895d559'/>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -57,8 +57,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182558-06'00')
|
||||
/ModDate(D:20090722182558-06'00')
|
||||
/CreationDate(D:20100422135553-06'00')
|
||||
/ModDate(D:20100422135553-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -75,7 +75,7 @@ xref
|
|||
0000000546 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<BF3BAD7CB407F5E17AE00BD540FA6C1B><BF3BAD7CB407F5E17AE00BD540FA6C1B>]
|
||||
/ID [<0A1E7255A8DE9CB04AA60879F660024B><0A1E7255A8DE9CB04AA60879F660024B>]
|
||||
>>
|
||||
startxref
|
||||
2184
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -43,10 +43,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-fcfa74cec07e' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-fcfa74cec07e' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:26:04-06:00' xap:CreateDate='2009-07-22T18:26:04-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-fcfa74cec07e' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f48f700f-af3b-11e9-0000-fcfa74cec07e'/>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-fcfa74cec07e' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-fcfa74cec07e' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-fcfa74cec07e' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:57-06:00' xap:CreateDate='2010-04-22T13:55:57-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-fcfa74cec07e' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9da29aad-8665-11ea-0000-fcfa74cec07e'/>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-fcfa74cec07e' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -56,8 +56,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182604-06'00')
|
||||
/ModDate(D:20090722182604-06'00')
|
||||
/CreationDate(D:20100422135557-06'00')
|
||||
/ModDate(D:20100422135557-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -74,7 +74,7 @@ xref
|
|||
0000000577 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<F1ECA86EA72818308D60B49648AD980D><F1ECA86EA72818308D60B49648AD980D>]
|
||||
/ID [<E91F774EC89995D6400B03C9EA77D9E7><E91F774EC89995D6400B03C9EA77D9E7>]
|
||||
>>
|
||||
startxref
|
||||
2215
|
||||
|
|
|
@ -42,10 +42,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-2bb5249de6dd' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-2bb5249de6dd' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:26:04-06:00' xap:CreateDate='2009-07-22T18:26:04-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-2bb5249de6dd' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f48f700f-af3b-11e9-0000-2bb5249de6dd'/>
|
||||
<rdf:Description rdf:about='f48f700f-af3b-11e9-0000-2bb5249de6dd' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-2bb5249de6dd' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-2bb5249de6dd' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:57-06:00' xap:CreateDate='2010-04-22T13:55:57-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-2bb5249de6dd' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9da29aad-8665-11ea-0000-2bb5249de6dd'/>
|
||||
<rdf:Description rdf:about='9da29aad-8665-11ea-0000-2bb5249de6dd' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -55,8 +55,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182604-06'00')
|
||||
/ModDate(D:20090722182604-06'00')
|
||||
/CreationDate(D:20100422135557-06'00')
|
||||
/ModDate(D:20100422135557-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -73,7 +73,7 @@ xref
|
|||
0000000622 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<5B1279F9960652F0F9499AE6C2394568><5B1279F9960652F0F9499AE6C2394568>]
|
||||
/ID [<6C51B73DC3A90C9A3E8D707F4552676C><6C51B73DC3A90C9A3E8D707F4552676C>]
|
||||
>>
|
||||
startxref
|
||||
2260
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -44,10 +44,10 @@ endobj
|
|||
<?adobe-xap-filters esc="CRLF"?>
|
||||
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='XMP toolkit 2.9.1-13, framework 1.6'>
|
||||
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:iX='http://ns.adobe.com/iX/1.0/'>
|
||||
<rdf:Description rdf:about='f1947f8f-af3b-11e9-0000-2bb4b895d559' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='f1947f8f-af3b-11e9-0000-2bb4b895d559' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2009-07-22T18:25:59-06:00' xap:CreateDate='2009-07-22T18:25:59-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='f1947f8f-af3b-11e9-0000-2bb4b895d559' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='f1947f8f-af3b-11e9-0000-2bb4b895d559'/>
|
||||
<rdf:Description rdf:about='f1947f8f-af3b-11e9-0000-2bb4b895d559' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:pdf='http://ns.adobe.com/pdf/1.3/' pdf:Producer='GPL Ghostscript 8.63'/>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:xap='http://ns.adobe.com/xap/1.0/' xap:ModifyDate='2010-04-22T13:55:53-06:00' xap:CreateDate='2010-04-22T13:55:53-06:00'><xap:CreatorTool>PLT Scheme</xap:CreatorTool></rdf:Description>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:xapMM='http://ns.adobe.com/xap/1.0/mm/' xapMM:DocumentID='9b4040ad-8665-11ea-0000-2bb4b895d559'/>
|
||||
<rdf:Description rdf:about='9b4040ad-8665-11ea-0000-2bb4b895d559' xmlns:dc='http://purl.org/dc/elements/1.1/' dc:format='application/pdf'><dc:title><rdf:Alt><rdf:li xml:lang='x-default'>Untitled</rdf:li></rdf:Alt></dc:title><dc:creator><rdf:Seq><rdf:li>mflatt@Macintosh \(Matthew Flatt\)</rdf:li></rdf:Seq></dc:creator></rdf:Description>
|
||||
</rdf:RDF>
|
||||
</x:xmpmeta>
|
||||
|
||||
|
@ -57,8 +57,8 @@ endstream
|
|||
endobj
|
||||
2 0 obj
|
||||
<</Producer(GPL Ghostscript 8.63)
|
||||
/CreationDate(D:20090722182559-06'00')
|
||||
/ModDate(D:20090722182559-06'00')
|
||||
/CreationDate(D:20100422135553-06'00')
|
||||
/ModDate(D:20100422135553-06'00')
|
||||
/Creator(PLT Scheme)
|
||||
/Author(mflatt@Macintosh \(Matthew Flatt\))>>endobj
|
||||
xref
|
||||
|
@ -75,7 +75,7 @@ xref
|
|||
0000000546 00000 n
|
||||
trailer
|
||||
<< /Size 10 /Root 1 0 R /Info 2 0 R
|
||||
/ID [<6E7272D6B2731DC8CB2BE347FB5EA742><6E7272D6B2731DC8CB2BE347FB5EA742>]
|
||||
/ID [<18F7F7D89292F20542678B75862EDC0C><18F7F7D89292F20542678B75862EDC0C>]
|
||||
>>
|
||||
startxref
|
||||
2184
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,11 +1,11 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
|
||||
(require scriblib/gui-eval)
|
||||
|
||||
(provide (rename-out [gui-interaction mr-interaction]
|
||||
[gui-interaction-eval mr-interaction-eval]
|
||||
[gui-schememod+eval mr-schememod+eval]
|
||||
[gui-schemeblock+eval mr-schemeblock+eval]
|
||||
[gui-racketmod+eval mr-racketmod+eval]
|
||||
[gui-racketblock+eval mr-racketblock+eval]
|
||||
[gui-def+int mr-def+int]
|
||||
[gui-defs+int mr-defs+int]
|
||||
[gui-interaction-eval-show mr-interaction-eval-show]))
|
||||
|
|
|
@ -7,20 +7,20 @@
|
|||
@; ----------------------------------------------------------------------
|
||||
|
||||
@(require scribble/manual
|
||||
"mreval.ss"
|
||||
"keep.ss"
|
||||
"mreval.rkt"
|
||||
"keep.rkt"
|
||||
scribble/urls
|
||||
scribble/struct
|
||||
scheme/class
|
||||
racket/class
|
||||
|
||||
(for-label scheme/base
|
||||
scheme/gui/base
|
||||
scheme/class
|
||||
(for-label racket/base
|
||||
racket/gui/base
|
||||
racket/class
|
||||
slideshow
|
||||
slideshow/code
|
||||
slideshow/flash)
|
||||
|
||||
(for-syntax scheme/base))
|
||||
(for-syntax racket/base))
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
||||
|
@ -31,14 +31,14 @@ endeavours, the picture library supports interesting and enlightening
|
|||
examples. After all, a picture is worth five hundred ``hello world''s.
|
||||
|
||||
Along the same lines, we assume that you will run the examples using
|
||||
@link[url:download-drscheme]{DrRacket}. Using DrRacket is the fastest
|
||||
@link[url:download-drracket]{DrRacket}. Using DrRacket is the fastest
|
||||
way to get a sense of what the language and system feels like, even if
|
||||
you eventually use Racket with Emacs, vi, or some other editor.
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
@section{Ready...}
|
||||
|
||||
@link[url:download-drscheme]{Download Racket}, install, and then
|
||||
@link[url:download-drracket]{Download Racket}, install, and then
|
||||
start DrRacket.
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
@ -49,7 +49,7 @@ part of a library for creating slide presentations. Copy the
|
|||
following into the @defterm{definitions area}, which is the top text
|
||||
area that you see in DrRacket:
|
||||
|
||||
@schememod[slideshow]
|
||||
@racketmod[slideshow]
|
||||
|
||||
Then click the @onscreen{Run} button. You'll see the text caret move
|
||||
to the bottom text area, which is the @defterm{interactions area}.
|
||||
|
@ -64,7 +64,7 @@ use the language declared in the source via the @menuitem["Language"
|
|||
When you type an expression after the @onscreen{>} in the interactions
|
||||
window and hit Enter, DrRacket evaluates the expression and prints its
|
||||
result. An expression can be just a value, such as the number
|
||||
@scheme[5] or the string @scheme["art gallery"]:
|
||||
@racket[5] or the string @racket["art gallery"]:
|
||||
|
||||
@mr-interaction[5 "art gallery"]
|
||||
|
||||
|
@ -74,15 +74,15 @@ function arguments, and then a close parenthesis, like this:
|
|||
|
||||
@mr-interaction[(circle 10)]
|
||||
|
||||
A result from the @scheme[circle] function is a picture value, which
|
||||
A result from the @racket[circle] function is a picture value, which
|
||||
prints as an expression result in much the same way that numbers or
|
||||
strings print. The argument to @scheme[circle] determines the
|
||||
strings print. The argument to @racket[circle] determines the
|
||||
circle's size in pixels. As you might guess, there's a
|
||||
@scheme[rectangle] function that takes two arguments instead of one:
|
||||
@racket[rectangle] function that takes two arguments instead of one:
|
||||
|
||||
@mr-interaction[(rectangle 10 20)]
|
||||
|
||||
Try giving @scheme[circle] the wrong number of arguments, just to see
|
||||
Try giving @racket[circle] the wrong number of arguments, just to see
|
||||
what happens:
|
||||
|
||||
@mr-interaction[(circle 10 20)]
|
||||
|
@ -90,28 +90,28 @@ what happens:
|
|||
Note that DrRacket highlights in pink the expression that triggered
|
||||
the error (but pink highlighting is not shown in this documentation).
|
||||
|
||||
In addition to basic picture constructors like @scheme[circle] and
|
||||
@scheme[rectangle], there's a @scheme[hc-append] function that
|
||||
In addition to basic picture constructors like @racket[circle] and
|
||||
@racket[rectangle], there's a @racket[hc-append] function that
|
||||
combines pictures. When you start composing function calls in Racket,
|
||||
it looks like this:
|
||||
|
||||
@mr-interaction[(hc-append (circle 10) (rectangle 10 20))]
|
||||
|
||||
The hyphen in the name @scheme[hc-append] is just a part of the
|
||||
identifier; it's not @schemeidfont{hc} minus
|
||||
@schemeidfont{append}. The function name starts with @scheme[h]
|
||||
The hyphen in the name @racket[hc-append] is just a part of the
|
||||
identifier; it's not @racketidfont{hc} minus
|
||||
@racketidfont{append}. The function name starts with @racket[h]
|
||||
because it combines pictures horizontally, and the next letter is
|
||||
@scheme[c] because the pictures are centered vertically.
|
||||
@racket[c] because the pictures are centered vertically.
|
||||
|
||||
If you wonder what other functions exist---perhaps a way to stack
|
||||
pictures vertically and left-aligned?---move the text caret to the
|
||||
name @scheme[hc-append] and press the F1 key in DrRacket. A browser
|
||||
name @racket[hc-append] and press the F1 key in DrRacket. A browser
|
||||
window will open, and it will give you a link to the documentation for
|
||||
@scheme[hc-append]. Click the link, and you'll see lots of other
|
||||
@racket[hc-append]. Click the link, and you'll see lots of other
|
||||
functions.
|
||||
|
||||
If you're reading this in HTML form, you can also just click on
|
||||
@scheme[hc-append] or any other imported identifier that is used in
|
||||
@racket[hc-append] or any other imported identifier that is used in
|
||||
this tutorial.
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
@ -122,34 +122,34 @@ simpler to give them names. Move back to the definitions area (the top
|
|||
area) and add two definitions, so that the complete content of the
|
||||
definitions area looks like this:
|
||||
|
||||
@mr-schememod+eval[
|
||||
@mr-racketmod+eval[
|
||||
slideshow
|
||||
(define c (circle 10))
|
||||
(define r (rectangle 10 20))
|
||||
]
|
||||
|
||||
Then click @onscreen{Run} again. Now, you can just type @scheme[c] or
|
||||
@scheme[r]:
|
||||
Then click @onscreen{Run} again. Now, you can just type @racket[c] or
|
||||
@racket[r]:
|
||||
|
||||
@mr-interaction[r (hc-append c r) (hc-append 20 c r c)]
|
||||
|
||||
As you can see, the @scheme[hc-append] function accepts an optional
|
||||
As you can see, the @racket[hc-append] function accepts an optional
|
||||
number argument before the picture arguments, and it accepts any
|
||||
number of picture arguments. When a number is provided, it specifies
|
||||
the amount of space to add between pictures.
|
||||
|
||||
We could have evaluated the @scheme[define] forms for @scheme[c] and
|
||||
@scheme[r] in the interactions area instead of the definitions
|
||||
We could have evaluated the @racket[define] forms for @racket[c] and
|
||||
@racket[r] in the interactions area instead of the definitions
|
||||
area. In practice, though, the definitions area is where your program
|
||||
lives---it's the file that you save---while the interaction area is
|
||||
for transient explorations and debugging tasks.
|
||||
|
||||
Let's add a function definition to the program. A function definition
|
||||
uses @scheme[define], just like our shape definitions, but with an
|
||||
uses @racket[define], just like our shape definitions, but with an
|
||||
open parenthesis before the function name, and names for the function
|
||||
arguments before the matching close parenthesis:
|
||||
|
||||
@mr-schemeblock+eval[
|
||||
@mr-racketblock+eval[
|
||||
(define (square n)
|
||||
(code:comment @#,t{A semi-colon starts a line comment.})
|
||||
(code:comment @#,t{The expression below is the function body.})
|
||||
|
@ -173,7 +173,7 @@ definition area.
|
|||
@; ----------------------------------------------------------------------
|
||||
@section{Local Binding}
|
||||
|
||||
The @scheme[define] form can be used in some places to create local
|
||||
The @racket[define] form can be used in some places to create local
|
||||
bindings. For example, it can be used inside a function body:
|
||||
|
||||
@mr-def+int[
|
||||
|
@ -183,10 +183,10 @@ bindings. For example, it can be used inside a function body:
|
|||
(four (circle 10))
|
||||
]
|
||||
|
||||
More typically, Racketeers use the @scheme[let] or @scheme[let*] form
|
||||
for local binding. An advantage of @scheme[let] is that it can be used
|
||||
More typically, Racketeers use the @racket[let] or @racket[let*] form
|
||||
for local binding. An advantage of @racket[let] is that it can be used
|
||||
in any expression position. Also, it binds many identifiers at once,
|
||||
instead of requiring a separate @scheme[define] for each identifier:
|
||||
instead of requiring a separate @racket[define] for each identifier:
|
||||
|
||||
@mr-def+int[
|
||||
(define (checker p1 p2)
|
||||
|
@ -197,8 +197,8 @@ instead of requiring a separate @scheme[define] for each identifier:
|
|||
(colorize (square 10) "black"))
|
||||
]
|
||||
|
||||
A @scheme[let] form binds many identifiers at the same time, so the
|
||||
bindings cannot refer to each other. The @scheme[let*] form, in
|
||||
A @racket[let] form binds many identifiers at the same time, so the
|
||||
bindings cannot refer to each other. The @racket[let*] form, in
|
||||
contrast, allows later bindings to use earlier bindings:
|
||||
|
||||
@mr-def+int[
|
||||
|
@ -214,13 +214,13 @@ contrast, allows later bindings to use earlier bindings:
|
|||
@; ----------------------------------------------------------------------
|
||||
@section{Functions are Values}
|
||||
|
||||
Instead of calling @scheme[circle] as a function, try evaluating just
|
||||
@scheme[circle] as an expression:
|
||||
Instead of calling @racket[circle] as a function, try evaluating just
|
||||
@racket[circle] as an expression:
|
||||
|
||||
@mr-interaction[circle]
|
||||
|
||||
That is, the identifier @scheme[circle] is bound to a function
|
||||
(a.k.a. ``procedure''), just like @scheme[c] is bound to a
|
||||
That is, the identifier @racket[circle] is bound to a function
|
||||
(a.k.a. ``procedure''), just like @racket[c] is bound to a
|
||||
circle. Unlike a circle picture, there's not a simple way of
|
||||
completely printing the function, so DrRacket just prints
|
||||
@procedure{circle}.
|
||||
|
@ -239,30 +239,30 @@ arguments:
|
|||
|
||||
When calling a function that accepts a function argument, the
|
||||
argument function often isn't needed anywhere else. Having to write
|
||||
down the function via @scheme[define] would be a hassle, because you
|
||||
down the function via @racket[define] would be a hassle, because you
|
||||
have to make up a name and find a place to put the function
|
||||
definition. The alternative is to use @scheme[lambda], which creates an
|
||||
definition. The alternative is to use @racket[lambda], which creates an
|
||||
anonymous function:
|
||||
|
||||
@mr-interaction[(series (lambda (size) (checkerboard (square size))))]
|
||||
|
||||
The parenthesized names after a @scheme[lambda] are the arguments to
|
||||
The parenthesized names after a @racket[lambda] are the arguments to
|
||||
the function, and the expression after the argument names is the
|
||||
function body. Using the word ``lambda'' instead of ``function'' or
|
||||
``procedure'' is part of Racket's history and culture.
|
||||
|
||||
A @scheme[define] form for a function is really a shorthand for a
|
||||
simple @scheme[define] using @scheme[lambda] as the value. For
|
||||
example, the @scheme[series] definition could be written as
|
||||
A @racket[define] form for a function is really a shorthand for a
|
||||
simple @racket[define] using @racket[lambda] as the value. For
|
||||
example, the @racket[series] definition could be written as
|
||||
|
||||
@schemeblock[
|
||||
@racketblock[
|
||||
(define series
|
||||
(lambda (mk)
|
||||
(hc-append 4 (mk 5) (mk 10) (mk 20))))
|
||||
]
|
||||
|
||||
Most Racketeers prefer to use the shorthand function form with
|
||||
@scheme[define] instead of expanding to @scheme[lambda].
|
||||
@racket[define] instead of expanding to @racket[lambda].
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
@section{Lexical Scope}
|
||||
|
@ -270,12 +270,12 @@ Most Racketeers prefer to use the shorthand function form with
|
|||
Racket is a lexically scoped language, which means that whenever an
|
||||
identifier is used as an expression, something in the textual
|
||||
environment of the expression determines the identifier's
|
||||
binding. This rule applies to identifiers in a @scheme[lambda] body as
|
||||
binding. This rule applies to identifiers in a @racket[lambda] body as
|
||||
well as anywhere else.
|
||||
|
||||
For example, in the following @scheme[rgb-series] function the uses
|
||||
of @scheme[mk] in each @scheme[lambda] form to refer to the argument of
|
||||
@scheme[rgb-series], since that's the binding that is textually in
|
||||
For example, in the following @racket[rgb-series] function the uses
|
||||
of @racket[mk] in each @racket[lambda] form to refer to the argument of
|
||||
@racket[rgb-series], since that's the binding that is textually in
|
||||
scope:
|
||||
|
||||
@mr-def+int[
|
||||
|
@ -288,7 +288,7 @@ scope:
|
|||
(rgb-series square)
|
||||
]
|
||||
|
||||
Here's another example, where @scheme[rgb-maker] takes a function and
|
||||
Here's another example, where @racket[rgb-maker] takes a function and
|
||||
returns a new one that remembers and uses the original function.
|
||||
|
||||
@mr-def+int[
|
||||
|
@ -301,9 +301,9 @@ returns a new one that remembers and uses the original function.
|
|||
(series (rgb-maker square))
|
||||
]
|
||||
|
||||
Note how composing functions via @scheme[rgb-maker] creates a
|
||||
Note how composing functions via @racket[rgb-maker] creates a
|
||||
different alignment of objects within the picture compared to using
|
||||
@scheme[rgb-series].
|
||||
@racket[rgb-series].
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
@section{Lists}
|
||||
|
@ -312,25 +312,23 @@ Racket inherits much of its style from the language Lisp, whose name
|
|||
originally stood for ``LISt Processor,'' and lists remain an important
|
||||
part of Racket.
|
||||
|
||||
The @scheme[list] function takes any number of arguments and returns
|
||||
The @racket[list] function takes any number of arguments and returns
|
||||
a list containing the given values:
|
||||
|
||||
@mr-interaction[(list "red" "green" "blue")
|
||||
(list (circle 10) (square 10))]
|
||||
|
||||
As you can see, a list prints as a pair of parentheses wrapped around
|
||||
As you can see, a list prints as a backquoted pair of parentheses wrapped around
|
||||
the printed form of the list elements. There's room for confusion
|
||||
here, because parentheses are used for both expressions, such as
|
||||
@scheme[(circle 10)], and printed results, such as
|
||||
@schemeresult[("red" "green" "blue")]. This connection between
|
||||
expressions and printed results is no coincidence, but we save that
|
||||
bit of culture for @seclink[#:doc '(lib
|
||||
"scribblings/guide/guide.scrbl") "quoting-lists"]{discussion
|
||||
elsewhere}. In the documentation and in DrRacket, result parentheses
|
||||
are printed in blue, unlike expression parentheses.
|
||||
@racket[(circle 10)], and printed results, such as
|
||||
@racketresult[`("red" "green" "blue")]. The backquote is the key difference,
|
||||
as @seclink[#:doc '(lib "scribblings/guide/guide.scrbl") "quoting-lists"]{discussed
|
||||
elsewhere}. To help emphasize the difference, in the documentation and in DrRacket,
|
||||
result parentheses are printed in blue, unlike expression parentheses.
|
||||
|
||||
If you have a list, then you'll eventually want to do something with
|
||||
each of the elements. The @scheme[map] function takes a list and a
|
||||
each of the elements. The @racket[map] function takes a list and a
|
||||
function to apply to each element of the list; it returns a new list
|
||||
to combine the function's results:
|
||||
|
||||
|
@ -342,21 +340,21 @@ to combine the function's results:
|
|||
(rainbow (square 5))
|
||||
]
|
||||
|
||||
Another function that works with lists is @scheme[apply]. Like
|
||||
@scheme[map], it takes a function and a list, but a function given
|
||||
to @scheme[apply] should take all of the arguments at once, instead of
|
||||
each one individually. The @scheme[apply] function is especially
|
||||
Another function that works with lists is @racket[apply]. Like
|
||||
@racket[map], it takes a function and a list, but a function given
|
||||
to @racket[apply] should take all of the arguments at once, instead of
|
||||
each one individually. The @racket[apply] function is especially
|
||||
useful with functions that take any number of arguments, such as
|
||||
@scheme[vc-append]:
|
||||
@racket[vc-append]:
|
||||
|
||||
@mr-interaction[
|
||||
(apply vc-append (rainbow (square 5)))
|
||||
]
|
||||
|
||||
Note that @scheme[(vc-append (rainbow (square 5)))] would not work,
|
||||
because @scheme[vc-append] does not want a list as an argument; it
|
||||
Note that @racket[(vc-append (rainbow (square 5)))] would not work,
|
||||
because @racket[vc-append] does not want a list as an argument; it
|
||||
wants a picture as an argument, and it is willing to accept any number
|
||||
of them. The @scheme[apply] function bridges the gap between a
|
||||
of them. The @racket[apply] function bridges the gap between a
|
||||
function that wants many arguments and a list of those arguments as a
|
||||
single value.
|
||||
|
||||
|
@ -365,17 +363,17 @@ single value.
|
|||
|
||||
Since your program in the definitions window starts with
|
||||
|
||||
@schememod[slideshow]
|
||||
@racketmod[slideshow]
|
||||
|
||||
all of the code that you put in the definitions window is inside a
|
||||
module. Furthermore, the module initially imports everything from the
|
||||
module designated by @schememodname[slideshow], which exports
|
||||
module designated by @racketmodname[slideshow], which exports
|
||||
picture-making functions as well as more commonly used functions
|
||||
such as @scheme[list] and @scheme[map].
|
||||
such as @racket[list] and @racket[map].
|
||||
|
||||
To import additional libraries, use the @scheme[require] form. For
|
||||
example, the library @schememodname[slideshow/flash] provides a
|
||||
@scheme[filled-flash] function:
|
||||
To import additional libraries, use the @racket[require] form. For
|
||||
example, the library @racketmodname[slideshow/flash] provides a
|
||||
@racket[filled-flash] function:
|
||||
|
||||
@mr-def+int[
|
||||
(require slideshow/flash)
|
||||
|
@ -389,10 +387,10 @@ Modules are named and distributed in various ways:
|
|||
@item{Some modules are packaged in the Racket distribution or
|
||||
otherwise installed into a hierarchy of
|
||||
@defterm{collections}. For example, the module name
|
||||
@schememodname[slideshow/flash] means ``the module implemented
|
||||
in the file @filepath{flash.ss} that is located in the
|
||||
@racketmodname[slideshow/flash] means ``the module implemented
|
||||
in the file @filepath{flash.rkt} that is located in the
|
||||
@filepath{slideshow} collection.'' When a module name includes
|
||||
no slash, then it refers to a @filepath{main.ss} file.}
|
||||
no slash, then it refers to a @filepath{main.rkt} file.}
|
||||
|
||||
@item{Some modules are distributed through the
|
||||
@link[url:planet]{@PLaneT} server, and they can be
|
||||
|
@ -400,42 +398,42 @@ Modules are named and distributed in various ways:
|
|||
that you evaluate the following fragment:
|
||||
|
||||
@mr-def+int[
|
||||
(require (planet "random.ss" ("schematics" "random.plt" 1 0)))
|
||||
(require (planet "random.rkt" ("schematics" "random.plt" 1 0)))
|
||||
(random-gaussian)
|
||||
]
|
||||
|
||||
DrRacket automatically downloads version 1.0 of the
|
||||
@filepath{random.plt} library and then imports the
|
||||
@filepath{random.ss} module.}
|
||||
@filepath{random.rkt} module.}
|
||||
|
||||
@item{Some modules live relative to other modules, without
|
||||
necessarily belonging to any particular collection or package.
|
||||
For example, in DrRacket, if you save your definitions so far in a
|
||||
file @filepath{quick.ss} and add the line
|
||||
file @filepath{quick.rkt} and add the line
|
||||
|
||||
@schemeblock[(provide rainbow square)]
|
||||
@racketblock[(provide rainbow square)]
|
||||
|
||||
then you can open a new tab or window in DrRacket, type the new
|
||||
program @filepath{use.ss} in the same directory as
|
||||
@filepath{quick.ss}:
|
||||
program @filepath{use.rkt} in the same directory as
|
||||
@filepath{quick.rkt}:
|
||||
|
||||
@schememod[
|
||||
scheme
|
||||
(require "quick.ss")
|
||||
@racketmod[
|
||||
racket
|
||||
(require "quick.rkt")
|
||||
(rainbow (square 5))
|
||||
]
|
||||
|
||||
and when you run @filepath{use.ss}, a rainbow list of squares
|
||||
is the output. Note that @filepath{use.ss} is written using
|
||||
the initial import @schememodname[scheme], which does not
|
||||
and when you run @filepath{use.rkt}, a rainbow list of squares
|
||||
is the output. Note that @filepath{use.rkt} is written using
|
||||
the initial import @racketmodname[racket], which does not
|
||||
supply any picture-making functions itself---but does provide
|
||||
@scheme[require] and the function-calling syntax.}
|
||||
@racket[require] and the function-calling syntax.}
|
||||
|
||||
]
|
||||
|
||||
Racketeers typically write new programs and libraries as modules that
|
||||
import each other through relative paths, and that use existing
|
||||
libraries from collections and @scheme[planet]. When a program or
|
||||
libraries from collections and @racket[planet]. When a program or
|
||||
library developed this way seems useful to others, it can be uploaded
|
||||
as a @PLaneT package or distributed in the more old-fashioned way as
|
||||
an installable collection archive (in either case without modifying
|
||||
|
@ -453,13 +451,13 @@ Here's another library to try:
|
|||
|
||||
Instead of a circle, the result is a picture of the code that, if it
|
||||
were used as an expression, would produce a circle. In other words,
|
||||
@scheme[code] is not a function, but instead a new syntactic form for
|
||||
@racket[code] is not a function, but instead a new syntactic form for
|
||||
creating pictures; the bit between the opening parenthesis with
|
||||
@scheme[code] is not an expression, but instead manipulated by the
|
||||
@scheme[code] syntactic form.
|
||||
@racket[code] is not an expression, but instead manipulated by the
|
||||
@racket[code] syntactic form.
|
||||
|
||||
This helps explain what we meant in the previous section when we said
|
||||
that @schememodname[scheme] provides @scheme[require] and the
|
||||
that @racketmodname[racket] provides @racket[require] and the
|
||||
function-calling syntax. Libraries are not restricted to exporting
|
||||
values, such as functions; they can also define new syntactic
|
||||
forms. In this sense, Racket isn't exactly a language at all; it's
|
||||
|
@ -467,7 +465,7 @@ more of an idea for how to structure a language so that you can extend
|
|||
it or create entirely new languages.
|
||||
|
||||
One way to introduce a new syntactic form is through
|
||||
@scheme[define-syntax] with @scheme[syntax-rules]:
|
||||
@racket[define-syntax] with @racket[syntax-rules]:
|
||||
|
||||
@mr-def+int[
|
||||
(define-syntax pict+code
|
||||
|
@ -479,27 +477,27 @@ One way to introduce a new syntactic form is through
|
|||
(pict+code (circle 10))
|
||||
]
|
||||
|
||||
This kind of definition is a macro. The @scheme[(pict+code expr)] part
|
||||
This kind of definition is a macro. The @racket[(pict+code expr)] part
|
||||
is a pattern for uses of the macro; instances of the pattern in a
|
||||
program are replaced by instances of the corresponding template, which
|
||||
is @scheme[(hc-append 10 expr (code expr))]. In particular,
|
||||
@scheme[(pict+code (circle 10))] matches the pattern with
|
||||
@scheme[(circle 10)] as @scheme[expr], so it is replaced with
|
||||
@scheme[(hc-append 10 (circle 10) (code (circle 10)))].
|
||||
is @racket[(hc-append 10 expr (code expr))]. In particular,
|
||||
@racket[(pict+code (circle 10))] matches the pattern with
|
||||
@racket[(circle 10)] as @racket[expr], so it is replaced with
|
||||
@racket[(hc-append 10 (circle 10) (code (circle 10)))].
|
||||
|
||||
Of course, the sword of syntactic extension cuts both ways: inventing
|
||||
a new language can make it easier to say what you want, but harder for
|
||||
others to understand. As it happens, the developers of Racket are
|
||||
constantly giving talks and writing papers that involve Racket code,
|
||||
and it's worthwhile for everyone who works on those products to know
|
||||
about @scheme[code].
|
||||
about @racket[code].
|
||||
|
||||
In fact, you might want to take a look at the @keep-file["quick.scrbl"]
|
||||
@link["quick.scrbl"]{source of this document}. You'll see that it
|
||||
starts with @schemefont{#lang}, but otherwise doesn't look a lot
|
||||
starts with @racketfont{#lang}, but otherwise doesn't look a lot
|
||||
like Racket; nevertheless, we build this document by running its
|
||||
source as a Racket program. We have to use a lot more than
|
||||
@scheme[syntax-rules] to extend Racket's syntax enough for writing
|
||||
@racket[syntax-rules] to extend Racket's syntax enough for writing
|
||||
documents, but Racket's syntactic extension can take you a long way.
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
@ -508,18 +506,18 @@ documents, but Racket's syntactic extension can take you a long way.
|
|||
An object system is another example of a sophisticated language
|
||||
extension that is worth learning and using for Racket users. Objects
|
||||
are sometimes better than functions, even when you have
|
||||
@scheme[lambda], and objects work especially well for graphical user
|
||||
@racket[lambda], and objects work especially well for graphical user
|
||||
interfaces. The API for Racket's GUI and graphics system is expressed
|
||||
in terms of objects and classes.
|
||||
|
||||
The class system itself is implemented by the
|
||||
@schememodname[scheme/class] library, and the
|
||||
@schememodname[scheme/gui/base] library provides the GUI and drawing
|
||||
@racketmodname[racket/class] library, and the
|
||||
@racketmodname[racket/gui/base] library provides the GUI and drawing
|
||||
classes. By convention, the classes are given names that end with
|
||||
@scheme[%]:
|
||||
@racket[%]:
|
||||
|
||||
@mr-defs+int[
|
||||
[(require scheme/class scheme/gui/base)
|
||||
[(require racket/class racket/gui/base)
|
||||
(define f (new frame% [label "My Art"]
|
||||
[width 300]
|
||||
[height 300]
|
||||
|
@ -529,18 +527,18 @@ classes. By convention, the classes are given names that end with
|
|||
|
||||
@(mr-interaction-eval (send f show #f))
|
||||
|
||||
The @scheme[new] form creates an instance of a class, where
|
||||
initialization arguments like @scheme[label] and @scheme[width] are
|
||||
provided by name. The @scheme[send] form calls a method of the object,
|
||||
such as @scheme[show], with arguments after the method name; the
|
||||
argument @scheme[#t] in this case is the boolean constant ``true.''
|
||||
The @racket[new] form creates an instance of a class, where
|
||||
initialization arguments like @racket[label] and @racket[width] are
|
||||
provided by name. The @racket[send] form calls a method of the object,
|
||||
such as @racket[show], with arguments after the method name; the
|
||||
argument @racket[#t] in this case is the boolean constant ``true.''
|
||||
|
||||
Pictures generated with @schememodname[slideshow] encapsulate a
|
||||
Pictures generated with @racketmodname[slideshow] encapsulate a
|
||||
function that uses the graphics toolbox's drawing commands to render
|
||||
the picture to a drawing context, such as a canvas in a frame. The
|
||||
@scheme[make-pict-drawer] function from @schememodname[slideshow]
|
||||
@racket[make-pict-drawer] function from @racketmodname[slideshow]
|
||||
exposes a picture's drawing function. We can use
|
||||
@scheme[make-pict-drawer] in a canvas-painting callback to draw a
|
||||
@racket[make-pict-drawer] in a canvas-painting callback to draw a
|
||||
picture into a canvas:
|
||||
|
||||
@mr-def+int[
|
||||
|
@ -571,8 +569,8 @@ that's how a frame manages its children by default.
|
|||
This introduction to Racket purposely avoids many of the
|
||||
traditional ways of introducing and distinguishing Lisp or Racket:
|
||||
prefix arithmetic notation, symbols, quoting and quasiquoting lists,
|
||||
@scheme[eval], first-class continuations, and the idea that all syntax
|
||||
is really just a @scheme[lambda] in disguise. While those are all part
|
||||
@racket[eval], first-class continuations, and the idea that all syntax
|
||||
is really just a @racket[lambda] in disguise. While those are all part
|
||||
of Racket, they are not the main ingredients of day-to-day programming
|
||||
in Racket.
|
||||
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/async-channel))
|
||||
(for-label racket/async-channel))
|
||||
|
||||
@(define async-eval
|
||||
(lambda ()
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require scheme/async-channel))
|
||||
(the-eval '(require racket/async-channel))
|
||||
the-eval)))
|
||||
|
||||
@title[#:tag "async-channel"]{Buffered Asynchronous Channels}
|
||||
|
||||
@note-lib-only[scheme/async-channel]
|
||||
@note-lib-only[racket/async-channel]
|
||||
|
||||
@margin-note/ref{See also @secref["threadmbox"].}
|
||||
|
||||
|
|
|
@ -218,7 +218,7 @@ values. For opaque structure types, @scheme[equal?] is the same as
|
|||
|
||||
@section{Boolean Synonyms}
|
||||
|
||||
@note-lib[scheme/bool]
|
||||
@note-lib[racket/bool]
|
||||
|
||||
@defthing[true boolean?]{A synonym for @scheme[#t].}
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scheme/class
|
||||
(for-syntax scheme/base)
|
||||
(for-label scheme/trait))
|
||||
racket/class
|
||||
(for-syntax racket/base)
|
||||
(for-label racket/trait))
|
||||
|
||||
@(begin
|
||||
|
||||
|
@ -70,14 +70,14 @@
|
|||
|
||||
)
|
||||
|
||||
@(interaction-eval #:eval class-eval (require scheme/class))
|
||||
@(interaction-eval #:eval class-eval (require racket/class))
|
||||
|
||||
|
||||
@title[#:tag "mzlib:class" #:style 'toc]{Classes and Objects}
|
||||
|
||||
@guideintro["classes"]{classes and objects}
|
||||
|
||||
@note-lib[scheme/class #:use-sources (racket/private/class-internal)]
|
||||
@note-lib[racket/class #:use-sources (racket/private/class-internal)]
|
||||
|
||||
A @deftech{class} specifies
|
||||
|
||||
|
@ -1275,7 +1275,7 @@ Evaluation of a @scheme[mixin] form checks that the
|
|||
|
||||
@section[#:tag "trait"]{Traits}
|
||||
|
||||
@note-lib-only[scheme/trait]
|
||||
@note-lib-only[racket/trait]
|
||||
|
||||
A @deftech{trait} is a collection of methods that can be converted to
|
||||
a @tech{mixin} and then applied to a @tech{class}. Before a trait is
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/cmdline))
|
||||
(for-label racket/cmdline))
|
||||
|
||||
@title{Command-Line Parsing}
|
||||
|
||||
@note-lib[scheme/cmdline]
|
||||
@note-lib[racket/cmdline]
|
||||
|
||||
@defform/subs[#:literals (multi once-each once-any final jelp-labels args
|
||||
help-labels =>)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
PLT Scheme supports multiple threads of control within a program,
|
||||
thread-local storage, some primitive synchronization mechanisms, and a
|
||||
framework for composing synchronization abstractions. In addition, the
|
||||
@scheme[scheme/future] library provides some support for parallelism
|
||||
@scheme[racket/future] library provides some support for parallelism
|
||||
to improve performance.
|
||||
|
||||
@local-table-of-contents[]
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
@(define contract-eval
|
||||
(lambda ()
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require scheme/contract))
|
||||
(the-eval '(require racket/contract))
|
||||
the-eval)))
|
||||
|
||||
@title[#:tag "contracts" #:style 'toc]{Contracts}
|
||||
|
@ -17,7 +17,7 @@ another. Programmers specify the behavior of a module exports via
|
|||
@scheme[provide/contract] and the contract system enforces those
|
||||
constraints.
|
||||
|
||||
@note-lib[scheme/contract #:use-sources (racket/contract/private/ds
|
||||
@note-lib[racket/contract #:use-sources (racket/contract/private/ds
|
||||
racket/contract/private/base
|
||||
racket/contract/private/guts
|
||||
racket/contract/private/misc
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/control))
|
||||
@(require (except-in "mz.ss" set)
|
||||
(for-label racket/control))
|
||||
|
||||
@title{Classical Control Operators}
|
||||
|
||||
@note-lib-only[scheme/control]
|
||||
@note-lib-only[racket/control]
|
||||
|
||||
@(define control-eval
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require scheme/control))
|
||||
(the-eval '(require racket/control))
|
||||
the-eval))
|
||||
|
||||
The @scheme[scheme/control] library provides various control operators
|
||||
The @scheme[racket/control] library provides various control operators
|
||||
from the research literature on higher-order control operators, plus a
|
||||
few extra convenience forms. These control operators are implemented
|
||||
in terms of @scheme[call-with-continuation-prompt],
|
||||
|
|
|
@ -1,19 +1,19 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-syntax scheme/base)
|
||||
(for-label scheme/serialize))
|
||||
(for-syntax racket/base)
|
||||
(for-label racket/serialize))
|
||||
|
||||
@(define posn-eval (make-base-eval))
|
||||
@(interaction-eval #:eval posn-eval (require (for-syntax scheme/base)))
|
||||
@(interaction-eval #:eval posn-eval (require (for-syntax racket/base)))
|
||||
|
||||
@title[#:tag "define-struct"]{Defining Structure Types: @scheme[define-struct]}
|
||||
@title[#:tag "define-struct"]{Defining Structure Types: @scheme[struct]}
|
||||
|
||||
@guideintro["define-struct"]{@scheme[define-struct]}
|
||||
|
||||
@defform/subs[(define-struct id-maybe-super (field ...)
|
||||
@defform/subs[(struct id maybe-super (field ...)
|
||||
struct-option ...)
|
||||
([id-maybe-super id
|
||||
(id super-id)]
|
||||
([maybe-super code:blank
|
||||
super-id]
|
||||
[field field-id
|
||||
[field-id field-option ...]]
|
||||
[struct-option #:mutable
|
||||
|
@ -34,7 +34,7 @@ Creates a new @techlink{structure type} (or uses a pre-existing
|
|||
structure type if @scheme[#:prefab] is specified), and binds
|
||||
transformers and variables related to the @tech{structure type}.
|
||||
|
||||
A @scheme[define-struct] form with @math{n} @scheme[field]s defines up
|
||||
A @scheme[struct] form with @math{n} @scheme[field]s defines up
|
||||
to @math{4+2n} names:
|
||||
|
||||
@itemize[
|
||||
|
@ -42,16 +42,15 @@ to @math{4+2n} names:
|
|||
@item{@schemeidfont{struct:}@scheme[id], a @deftech{structure type
|
||||
descriptor} value that represents the @tech{structure type}.}
|
||||
|
||||
@item{@scheme[constructor-id] (which defaults to
|
||||
@schemeidfont{make-}@scheme[id]), a @deftech{constructor}
|
||||
procedure that takes @math{m} arguments and returns a new
|
||||
instance of the @tech{structure type}, where @math{m} is the
|
||||
number of @scheme[field]s that do not include an
|
||||
@scheme[#:auto] option.}
|
||||
@item{@scheme[constructor-id] (which defaults to @scheme[id]), a
|
||||
@deftech{constructor} procedure that takes @math{m} arguments
|
||||
and returns a new instance of the @tech{structure type}, where
|
||||
@math{m} is the number of @scheme[field]s that do not include
|
||||
an @scheme[#:auto] option.}
|
||||
|
||||
@item{@scheme[id]@schemeidfont{?}, a @deftech{predicate} procedure
|
||||
that returns @scheme[#t] for instances of the @tech{structure
|
||||
type} (constructed by @schemeidfont{make-}@scheme[id] or the
|
||||
type} (constructed by @scheme[constructor-id] or the
|
||||
@tech{constructor} for a subtype) and @scheme[#f] for any other
|
||||
value.}
|
||||
|
||||
|
@ -125,7 +124,7 @@ If the @scheme[#:omit-define-syntaxes] option is supplied, then
|
|||
@scheme[id] is not bound as a transformer. If the
|
||||
@scheme[#:omit-define-values] option is supplied, then none of the
|
||||
usual variables are bound, but @scheme[id] is bound. If both are
|
||||
supplied, then the @scheme[define-struct] form is equivalent to
|
||||
supplied, then the @scheme[struct] form is equivalent to
|
||||
@scheme[(begin)].
|
||||
|
||||
If @scheme[#:auto] is supplied as a @scheme[field-option], then the
|
||||
|
@ -147,27 +146,28 @@ For serialization, see @scheme[define-serializable-struct].
|
|||
|
||||
@defexamples[
|
||||
#:eval posn-eval
|
||||
(define-struct posn (x y [z #:auto])
|
||||
(struct posn (x y [z #:auto])
|
||||
#:auto-value 0
|
||||
#:transparent)
|
||||
(make-posn 1 2)
|
||||
(posn? (make-posn 1 2))
|
||||
(posn-y (make-posn 1 2))
|
||||
(posn 1 2)
|
||||
(posn? (posn 1 2))
|
||||
(posn-y (posn 1 2))
|
||||
]
|
||||
|
||||
@defs+int[
|
||||
#:eval posn-eval
|
||||
[(define-struct (color-posn posn) (hue) #:mutable)
|
||||
(define cp (make-color-posn 1 2 "blue"))]
|
||||
[(struct color-posn posn (hue) #:mutable)
|
||||
(define cp (color-posn 1 2 "blue"))]
|
||||
(color-posn-hue cp)
|
||||
cp
|
||||
(set-posn-z! cp 3)
|
||||
]}
|
||||
|
||||
|
||||
@defform[(struct-field-index field-id)]{
|
||||
|
||||
This form can only appear as an expression within a
|
||||
@scheme[define-struct] form; normally, it is used with
|
||||
@scheme[struct] form; normally, it is used with
|
||||
@scheme[#:property], especially for a property like
|
||||
@scheme[prop:procedure]. The result of a @scheme[struct-field-index]
|
||||
expression is an exact, non-negative integer that corresponds to the
|
||||
|
@ -176,13 +176,37 @@ position within the structure declaration of the field named by
|
|||
|
||||
@defexamples[
|
||||
#:eval posn-eval
|
||||
(define-struct mood-procedure (base rating)
|
||||
(struct mood-procedure (base rating)
|
||||
#:property prop:procedure (struct-field-index base))
|
||||
(define happy+ (make-mood-procedure add1 10))
|
||||
(define happy+ (mood-procedure add1 10))
|
||||
(happy+ 2)
|
||||
(mood-procedure-rating happy+)
|
||||
]}
|
||||
|
||||
|
||||
@defform/subs[(define-struct id-maybe-super (field ...)
|
||||
struct-option ...)
|
||||
([id-maybe-super id
|
||||
(id super-id)])]{
|
||||
|
||||
Like @scheme[struct], except that the syntax for supplying a
|
||||
@scheme[super-id] is different, and the default constructor name
|
||||
use a @schemeidfont{make-} prefix on @scheme[id].
|
||||
|
||||
This form is provided for backward compatibility; @scheme[struct] is
|
||||
preferred.
|
||||
|
||||
@defexamples[
|
||||
#:eval posn-eval
|
||||
(define-struct posn (x y [z #:auto])
|
||||
#:auto-value 0
|
||||
#:transparent)
|
||||
(make-posn 1 2)
|
||||
(posn? (make-posn 1 2))
|
||||
(posn-y (make-posn 1 2))
|
||||
]}
|
||||
|
||||
|
||||
@defform[(define-struct/derived (id . rest-form)
|
||||
id-maybe-super (field ...) struct-option ...)]{
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
scribble/eval)
|
||||
|
||||
@(define dict-eval (make-base-eval))
|
||||
@(interaction-eval #:eval dict-eval (require scheme/dict))
|
||||
@(interaction-eval #:eval dict-eval (require racket/dict))
|
||||
|
||||
@title[#:tag "dicts"]{Dictionaries}
|
||||
|
||||
|
@ -24,7 +24,7 @@ values. The following datatypes are all dictionaries:
|
|||
|
||||
]
|
||||
|
||||
@note-lib[scheme/dict]
|
||||
@note-lib[racket/dict]
|
||||
|
||||
@defproc[(dict? [v any/c]) boolean?]{
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/port))
|
||||
(for-label racket/port))
|
||||
|
||||
@title[#:tag "encodings"]{Encodings and Locales}
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/enter))
|
||||
(for-label racket/enter))
|
||||
|
||||
@title[#:tag "enter"]{Interactive Module Loading}
|
||||
|
||||
@note-init-lib[scheme/enter]
|
||||
@note-init-lib[racket/enter]
|
||||
|
||||
@defform*[[(enter! module-path)
|
||||
(enter! #f)]]{
|
||||
|
@ -27,7 +27,7 @@ are first loaded (either directly or indirectly through transitive
|
|||
@scheme[require]s) via @scheme[enter!].
|
||||
|
||||
After switching namespaces to the designated module, @scheme[enter!]
|
||||
automatically requires @scheme[scheme/enter] into the namespace, so
|
||||
automatically requires @scheme[racket/enter] into the namespace, so
|
||||
that @scheme[enter!] can be used to switch namespaces again.
|
||||
|
||||
When it loads or re-loads a module from a file, @scheme[enter!] prints
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require scribble/struct
|
||||
scribble/scheme
|
||||
(for-syntax scheme/base)
|
||||
(for-syntax racket/base)
|
||||
"mz.ss"
|
||||
"prog-steps.ss")
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require scribble/bnf
|
||||
"mz.ss"
|
||||
(for-label scheme/fixnum))
|
||||
(for-label racket/fixnum))
|
||||
|
||||
@title[#:tag "exns"]{Exceptions}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scheme/file)
|
||||
racket/file)
|
||||
|
||||
@(begin
|
||||
;; ignore expressions at the top-level so that they don't print #<void>
|
||||
|
@ -12,8 +12,8 @@
|
|||
(define file-eval
|
||||
(lambda ()
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require (for-syntax scheme/base)
|
||||
scheme/file))
|
||||
(the-eval '(require (for-syntax racket/base)
|
||||
racket/file))
|
||||
(the-eval '(define some-file (make-temporary-file)))
|
||||
(the-eval '(define some-other-file (make-temporary-file)))
|
||||
the-eval)))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label framework/preferences
|
||||
scheme/runtime-path
|
||||
racket/runtime-path
|
||||
setup/dirs))
|
||||
|
||||
@title{Filesystem}
|
||||
|
@ -398,9 +398,9 @@ can be particularly slow under Windows.}
|
|||
@;------------------------------------------------------------------------
|
||||
@section[#:tag "runtime-path"]{Declaring Paths Needed at Run Time}
|
||||
|
||||
@note-lib-only[scheme/runtime-path]
|
||||
@note-lib-only[racket/runtime-path]
|
||||
|
||||
The @schememodname[scheme/runtime-path] library provides forms for
|
||||
The @schememodname[racket/runtime-path] library provides forms for
|
||||
accessing files and directories at run time using a path that are
|
||||
usually relative to an enclosing source file. Unlike using
|
||||
@scheme[collection-path], @scheme[define-runtime-path] exposes each
|
||||
|
@ -409,7 +409,7 @@ so that files and directories needed at run time are carried along in
|
|||
a distribution.
|
||||
|
||||
In addition to the bindings described below,
|
||||
@schememodname[scheme/runtime-path] provides @scheme[#%datum] in
|
||||
@schememodname[racket/runtime-path] provides @scheme[#%datum] in
|
||||
@tech{phase level} 1, since string constants are often used as
|
||||
compile-time expressions with @scheme[define-runtime-path].
|
||||
|
||||
|
@ -426,7 +426,7 @@ result of @scheme[expr]. The path is normally computed by taking a
|
|||
relative path result from @scheme[expr] and adding it to a path for
|
||||
the enclosing file (which is computed as described below). However,
|
||||
tools like the executable creator can also arrange (by colluding with
|
||||
@schememodname[scheme/runtime-path]) to have a different base path
|
||||
@schememodname[racket/runtime-path]) to have a different base path
|
||||
substituted in a generated executable. If @scheme[expr] produces an
|
||||
absolute path, it is normally returned directly, but again may be
|
||||
replaced by an executable creator. In all cases, the executable
|
||||
|
@ -579,7 +579,7 @@ bound through @scheme[define-runtime-module-path].}
|
|||
@;------------------------------------------------------------------------
|
||||
@section[#:tag "file-lib"]{More File and Directory Utilities}
|
||||
|
||||
@note-lib[scheme/file]
|
||||
@note-lib[racket/file]
|
||||
|
||||
@defproc[(file->string [path path-string?]
|
||||
[#:mode mode-flag (or/c 'binary 'text) 'binary])
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme
|
||||
scheme/base
|
||||
scheme/contract
|
||||
scheme/future))
|
||||
(for-label racket/future))
|
||||
|
||||
@(define future-eval (make-base-eval))
|
||||
@(interaction-eval #:eval future-eval (require scheme/future))
|
||||
@(interaction-eval #:eval future-eval (require racket/future))
|
||||
|
||||
@title[#:tag "futures"]{Futures for Parallelism}
|
||||
|
||||
@guideintro["effective-futures"]{futures}
|
||||
|
||||
@note-lib[scheme/future]
|
||||
@note-lib[racket/future]
|
||||
|
||||
@margin-note{Currently, parallel support for @scheme[future] is
|
||||
enabled by default for Windows, Linux x86/x86_64, and Mac OS X
|
||||
|
@ -21,7 +18,7 @@ x86/x86_64. To enable support for other platforms, use
|
|||
Scheme.}
|
||||
|
||||
The @scheme[future] and @scheme[touch] functions from
|
||||
@schememodname[scheme/future] provide access to parallelism as
|
||||
@schememodname[racket/future] provide access to parallelism as
|
||||
supported by the hardware and operation system.
|
||||
In contrast to @scheme[thread], which provides concurrency for
|
||||
arbitrary computations without parallelism, @scheme[future] provides
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
@(require "mz.ss"
|
||||
scribble/core
|
||||
scribble/html-properties
|
||||
(for-label scheme/help
|
||||
(for-label racket/help
|
||||
net/url
|
||||
scheme/gui))
|
||||
racket/gui/base))
|
||||
|
||||
@; Beware of this hard-wired link to the main doc page:
|
||||
@(define main-doc-page
|
||||
|
@ -18,7 +18,7 @@
|
|||
|
||||
@title{Interactive Help}
|
||||
|
||||
@note-init-lib[scheme/help]
|
||||
@note-init-lib[racket/help]
|
||||
|
||||
@deftogether[(
|
||||
@defidform[help]
|
||||
|
@ -67,8 +67,8 @@ introduces a binding without actually executing the
|
|||
documentation, but cannot or do not want to run the providing module.
|
||||
|
||||
@schemeblock[
|
||||
(require scheme/gui) (code:comment @#,t{does not work in @exec{mzscheme}})
|
||||
(require (for-label scheme/gui)) (code:comment @#,t{ok in @exec{mzscheme}})
|
||||
(require racket/gui) (code:comment @#,t{does not work in @exec{mzscheme}})
|
||||
(require (for-label racket/gui)) (code:comment @#,t{ok in @exec{mzscheme}})
|
||||
(help frame%)
|
||||
]
|
||||
|
||||
|
@ -82,7 +82,7 @@ The @scheme[(help id #:from module-path)] variant is similar to
|
|||
@scheme[for-label] in a temporary namespace.)
|
||||
|
||||
@schemeblock[
|
||||
(help frame% #:from scheme/gui) (code:comment @#,t{equivalent to the above})
|
||||
(help frame% #:from racket/gui) (code:comment @#,t{equivalent to the above})
|
||||
]
|
||||
|
||||
The @scheme[(help #:search datum ...)] form is similar to
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
@title[#:tag "include"]{File Inclusion}
|
||||
|
||||
@note-lib[scheme/include]
|
||||
@note-lib[racket/include]
|
||||
|
||||
@defform/subs[#:literals (file lib)
|
||||
(include path-spec)
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/pretty
|
||||
scheme/gui/base))
|
||||
(for-label racket/pretty
|
||||
racket/gui/base))
|
||||
|
||||
@title{Init Libraries}
|
||||
|
||||
@defmodule*/no-declare[(scheme/init)]{The @schememodname[scheme/init]
|
||||
@defmodule*/no-declare[(racket/init)]{The @schememodname[racket/init]
|
||||
library is the default start-up library for MzScheme. It re-exports
|
||||
the @schememodname[scheme], @schememodname[scheme/enter] and
|
||||
@schememodname[scheme/help] libraries, and it sets
|
||||
the @schememodname[scheme], @schememodname[racket/enter] and
|
||||
@schememodname[racket/help] libraries, and it sets
|
||||
@scheme[current-print] to use @scheme[pretty-print].}
|
||||
|
||||
@defmodule*/no-declare[(scheme/gui/init)]{The
|
||||
@schememodname[scheme/gui/init] library is the default start-up
|
||||
library for MrEd. It re-exports the @schememodname[scheme/init] and
|
||||
@schememodname[scheme/gui/base] libraries, and it sets
|
||||
@defmodule*/no-declare[(racket/gui/init)]{The
|
||||
@schememodname[racket/gui/init] library is the default start-up
|
||||
library for MrEd. It re-exports the @schememodname[racket/init] and
|
||||
@schememodname[racket/gui/base] libraries, and it sets
|
||||
@scheme[current-load] to use @scheme[text-editor-load-handler].}
|
||||
|
|
|
@ -1,59 +1,59 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss")
|
||||
|
||||
@title[#:tag "load-lang"]{The @schememodname[scheme/load] Language}
|
||||
@title[#:tag "load-lang"]{The @schememodname[racket/load] Language}
|
||||
|
||||
@defmodulelang[scheme/load]
|
||||
@defmodulelang[racket/load]
|
||||
|
||||
The @schememodname[scheme/load] language supports traditional Scheme
|
||||
The @schememodname[racket/load] language supports traditional Scheme
|
||||
evaluation, where each top-level form in the module body is separately
|
||||
passed to @scheme[eval] in the same way as for @scheme[load].
|
||||
|
||||
The namespace for evaluation shares the @tech{module registry} with
|
||||
the @schememodname[scheme/load] module instance, but it has a separate
|
||||
the @schememodname[racket/load] module instance, but it has a separate
|
||||
top-level environment, and it is initialized with the bindings of
|
||||
@schememodname[scheme]. A single namespace is created for each
|
||||
instance of the @schememodname[scheme/load] module (i.e., multiple
|
||||
modules using the @schememodname[scheme/load] language share a
|
||||
namespace). The @scheme[scheme/load] library exports only
|
||||
instance of the @schememodname[racket/load] module (i.e., multiple
|
||||
modules using the @schememodname[racket/load] language share a
|
||||
namespace). The @scheme[racket/load] library exports only
|
||||
@schemeidfont{#%module-begin} and @schemeidfont{#%top-interaction}
|
||||
forms that effectively swap in the evaluation namespace and call
|
||||
@scheme[eval].
|
||||
|
||||
For example, the body of a module using @scheme[scheme/load] can
|
||||
For example, the body of a module using @scheme[racket/load] can
|
||||
include @scheme[module] forms, so that running the following module
|
||||
prints @schemeresultfont{5}:
|
||||
|
||||
@schememod[
|
||||
scheme/load
|
||||
racket/load
|
||||
|
||||
(module m scheme/base
|
||||
(module m racket/base
|
||||
(provide x)
|
||||
(define x 5))
|
||||
|
||||
(module n scheme/base
|
||||
(module n racket/base
|
||||
(require 'm)
|
||||
(display x))
|
||||
|
||||
(require 'n)
|
||||
]
|
||||
|
||||
Definitions in a module using @scheme[scheme/load] are evaluated in
|
||||
Definitions in a module using @scheme[racket/load] are evaluated in
|
||||
the current namespace, which means that @scheme[load] and
|
||||
@scheme[eval] can see the definitions. For example, running the
|
||||
following module prints @schemeresultfont{6}:
|
||||
|
||||
@schememod[
|
||||
scheme/load
|
||||
racket/load
|
||||
|
||||
(define x 6)
|
||||
(display (eval 'x))
|
||||
]
|
||||
|
||||
Since all forms within a @schememodname[scheme/load] module are
|
||||
Since all forms within a @schememodname[racket/load] module are
|
||||
evaluated in the top level, bindings cannot be exported from the
|
||||
module using @scheme[provide]. Similarly, since evaluation of the
|
||||
module-body forms is inherently dynamic, compilation of the module
|
||||
provides essentially no benefit. For these reasons, use
|
||||
@schememodname[scheme/load] for interactive exploration of top-level
|
||||
@schememodname[racket/load] for interactive exploration of top-level
|
||||
forms only, and not for constructing larger programs.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/cmdline))
|
||||
(for-label racket/cmdline))
|
||||
|
||||
@title[#:tag "logging"]{Logging}
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#lang scheme/base
|
||||
#lang racket/base
|
||||
(require scribble/scheme
|
||||
scribble/basic
|
||||
scribble/struct
|
||||
scribble/manual
|
||||
(for-label scheme/base))
|
||||
(for-label racket/base))
|
||||
|
||||
(provide parse-match-grammar)
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
"match-grammar.ss"
|
||||
scheme/match)
|
||||
racket/match)
|
||||
|
||||
@(define match-eval (make-base-eval))
|
||||
@(interaction-eval #:eval match-eval (require scheme/match))
|
||||
@(interaction-eval #:eval match-eval (require racket/match))
|
||||
|
||||
@title[#:tag "match"]{Pattern Matching}
|
||||
|
||||
|
@ -14,7 +14,7 @@ The @scheme[match] form and related forms support general pattern
|
|||
matching on Scheme values. See also @secref["regexp"] for information
|
||||
on regular-expression matching on strings, bytes, and streams.
|
||||
|
||||
@note-lib[scheme/match #:use-sources (scheme/match)]
|
||||
@note-lib[racket/match #:use-sources (racket/match)]
|
||||
|
||||
@defform/subs[(match val-expr clause ...)
|
||||
([clause [pat expr ...+]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scribble/scheme
|
||||
(for-label scheme/mpair))
|
||||
(for-label racket/mpair))
|
||||
|
||||
@title[#:tag "mpairs"]{Mutable Pairs and Lists}
|
||||
|
||||
|
@ -52,7 +52,7 @@ Changes the @tech{mutable pair} @scheme[p] so that its second element is
|
|||
@; ----------------------------------------
|
||||
@section{Mutable List Functions}
|
||||
|
||||
@note-lib-only[scheme/mpair]
|
||||
@note-lib-only[racket/mpair]
|
||||
|
||||
For functions described in this section, contracts are not directly
|
||||
enforced. In particular, when a @tech{mutable list} is expected,
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
(module mz scheme/base
|
||||
(module mz racket/base
|
||||
(require scribble/struct
|
||||
scribble/manual
|
||||
scribble/eval
|
||||
scribble/decode
|
||||
scheme/contract
|
||||
racket/contract
|
||||
"../icons.ss")
|
||||
|
||||
(provide (all-from-out scribble/manual)
|
||||
(all-from-out scribble/eval)
|
||||
(all-from-out scheme/contract))
|
||||
(all-from-out racket/contract))
|
||||
|
||||
(require (for-label scheme))
|
||||
(provide (for-label (all-from-out scheme)))
|
||||
(require (for-label racket))
|
||||
(provide (for-label (all-from-out racket)))
|
||||
|
||||
(provide mz-examples)
|
||||
(define mz-eval (make-base-eval))
|
||||
|
@ -30,7 +30,7 @@
|
|||
(syntax-rules ()
|
||||
[(_ lib #:use-sources (src ...) . more)
|
||||
(begin
|
||||
(declare-exporting lib scheme #:use-sources (src ...))
|
||||
(declare-exporting lib racket #:use-sources (src ...))
|
||||
(defmodule*/no-declare (lib)
|
||||
(t (make-collect-element
|
||||
#f null
|
||||
|
@ -39,8 +39,8 @@
|
|||
"The bindings documented in this section are provided by the "
|
||||
(schememodname lib)
|
||||
" and "
|
||||
(schememodname scheme)
|
||||
" libraries, but not " (schememodname scheme/base)
|
||||
(schememodname racket)
|
||||
" libraries, but not " (schememodname racket/base)
|
||||
"."
|
||||
. more)))]
|
||||
[(_ lib . more)
|
||||
|
@ -51,16 +51,16 @@
|
|||
(syntax-rules ()
|
||||
[(_ lib #:use-sources (src ...) . more)
|
||||
(begin
|
||||
(declare-exporting lib scheme/init #:use-sources (src ...))
|
||||
(declare-exporting lib racket/init #:use-sources (src ...))
|
||||
(defmodule*/no-declare (lib)
|
||||
(t "The bindings documented in this section are provided by the "
|
||||
(schememodname lib)
|
||||
" and "
|
||||
(schememodname scheme/init)
|
||||
(schememodname racket/init)
|
||||
" libraries, which means that they are available when "
|
||||
(exec "mzscheme") " is started with no command-line arguments."
|
||||
" They are not provided by " (schememodname scheme/base)
|
||||
" or " (schememodname scheme) "."
|
||||
(exec "racket") " is started with no command-line arguments."
|
||||
" They are not provided by " (schememodname racket/base)
|
||||
" or " (schememodname racket) "."
|
||||
. more)))]
|
||||
[(_ lib . more)
|
||||
(note-init-lib lib #:use-sources () . more)]))
|
||||
|
@ -72,8 +72,8 @@
|
|||
(defmodule lib #:use-sources (src ...)
|
||||
(t "The bindings documented in this section are provided by the "
|
||||
(schememodname lib)
|
||||
" library, not " (schememodname scheme/base)
|
||||
" or " (schememodname scheme)
|
||||
" library, not " (schememodname racket/base)
|
||||
" or " (schememodname racket)
|
||||
"."
|
||||
. more))]
|
||||
[(_ lib . more)
|
||||
|
|
|
@ -30,7 +30,7 @@ with @scheme[namespace-attach-module].}
|
|||
|
||||
@defproc[(make-base-empty-namespace) namespace?]{
|
||||
|
||||
Creates a new empty namespace, but with @schememodname[scheme/base]
|
||||
Creates a new empty namespace, but with @schememodname[racket/base]
|
||||
attached. The namespace's @tech{base phase} is the same as the
|
||||
@tech{phase} in which the @scheme[make-base-empty-namespace]
|
||||
function was created.}
|
||||
|
@ -38,7 +38,7 @@ function was created.}
|
|||
|
||||
@defproc[(make-base-namespace) namespace?]{
|
||||
|
||||
Creates a new namespace with @schememodname[scheme/base] attached and
|
||||
Creates a new namespace with @schememodname[racket/base] attached and
|
||||
@scheme[require]d into the top-level environment. The namespace's
|
||||
@tech{base phase} is the same as the @tech{phase} in which the
|
||||
@scheme[make-base-namespace] function was created.}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
@;------------------------------------------------------------------------
|
||||
@section[#:tag "tcp"]{TCP}
|
||||
|
||||
@note-lib[scheme/tcp]
|
||||
@note-lib[racket/tcp]
|
||||
|
||||
For information about TCP in general, see @italic{TCP/IP Illustrated,
|
||||
Volume 1} by W. Richard Stevens.
|
||||
|
@ -257,7 +257,7 @@ port returned by @scheme[tcp-accept], @scheme[tcp-connect],
|
|||
@;------------------------------------------------------------------------
|
||||
@section[#:tag "udp"]{UDP}
|
||||
|
||||
@note-lib[scheme/udp]
|
||||
@note-lib[racket/udp]
|
||||
|
||||
For information about UDP in general, see @italic{TCP/IP Illustrated,
|
||||
Volume 1} by W. Richard Stevens.
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scheme/math
|
||||
racket/math
|
||||
scribble/extract
|
||||
(for-label scheme/math
|
||||
scheme/flonum
|
||||
scheme/fixnum
|
||||
scheme/unsafe/ops
|
||||
scheme/require))
|
||||
(for-label racket/math
|
||||
racket/flonum
|
||||
racket/fixnum
|
||||
racket/unsafe/ops
|
||||
racket/require))
|
||||
|
||||
@(define math-eval (make-base-eval))
|
||||
@(interaction-eval #:eval math-eval (require scheme/math))
|
||||
@(interaction-eval #:eval math-eval (require racket/math))
|
||||
|
||||
@title[#:tag "numbers"]{Numbers}
|
||||
|
||||
|
@ -70,7 +70,7 @@ infinity, or @scheme[+nan.0] if no such limit exists.
|
|||
A @deftech{fixnum} is an exact integer whose two's complement
|
||||
representation fit into 31 bits on a 32-bit platform or 63 bits on a
|
||||
64-bit platform; furthermore, no allocation is required when computing
|
||||
with fixnums. See also the @schememodname[scheme/fixnum] module, below.
|
||||
with fixnums. See also the @schememodname[racket/fixnum] module, below.
|
||||
|
||||
Two fixnums that are @scheme[=] are also the same
|
||||
according to @scheme[eq?]. Otherwise, the result of @scheme[eq?]
|
||||
|
@ -875,9 +875,9 @@ is little-endian.}
|
|||
@; ------------------------------------------------------------------------
|
||||
@section{Inexact-Real (Flonum) Operations}
|
||||
|
||||
@defmodule[scheme/flonum]
|
||||
@defmodule[racket/flonum]
|
||||
|
||||
The @schememodname[scheme/flonum] library provides operations like
|
||||
The @schememodname[racket/flonum] library provides operations like
|
||||
@scheme[fl+] that consume and produce only real @tech{inexact
|
||||
numbers}, which are also known as @deftech{flonums}. Flonum-specific
|
||||
operations provide can better performance when used consistently, and
|
||||
|
@ -953,10 +953,10 @@ so the result is always a @tech{flonum}.
|
|||
A @deftech{flvector} is like a @tech{vector}, but it holds only
|
||||
inexact real numbers. This representation can be more compact, and
|
||||
unsafe operations on @tech{flvector}s (see
|
||||
@schememodname[scheme/unsafe/ops]) can execute more efficiently than
|
||||
@schememodname[racket/unsafe/ops]) can execute more efficiently than
|
||||
unsafe operations on @tech{vectors} of inexact reals.
|
||||
|
||||
An f64vector as provided by @schememodname[scheme/foreign] stores the
|
||||
An f64vector as provided by @schememodname[racket/unsafe/ffi] stores the
|
||||
same kinds of values as an @tech{flvector}, but with extra
|
||||
indirections that make f64vectors more convenient for working with
|
||||
foreign libraries. The lack of indirections make unsafe
|
||||
|
@ -1005,25 +1005,25 @@ first slot is position @scheme[0], and the last slot is one less than
|
|||
|
||||
@section{Fixnum Operations}
|
||||
|
||||
@defmodule[scheme/fixnum]
|
||||
@defmodule[racket/fixnum]
|
||||
|
||||
The @schememodname[scheme/fixnum] library provides operations like
|
||||
The @schememodname[racket/fixnum] library provides operations like
|
||||
@scheme[fx+] that consume and produce only fixnums. The operations in
|
||||
this library are meant to be safe versions of unsafe operations like
|
||||
@scheme[unsafe-fx+]. These safe operations are generally no faster
|
||||
than using generic primitives like @scheme[+].
|
||||
|
||||
The expected use of the @schememodname[scheme/fixnum] library is for
|
||||
code where the @scheme[require] of @schememodname[scheme/fixnum] is
|
||||
The expected use of the @schememodname[racket/fixnum] library is for
|
||||
code where the @scheme[require] of @schememodname[racket/fixnum] is
|
||||
replaced with
|
||||
|
||||
@schemeblock[(require (filtered-in
|
||||
(λ (name) (regexp-replace #rx"unsafe-" name ""))
|
||||
scheme/unsafe/ops))]
|
||||
racket/unsafe/ops))]
|
||||
|
||||
to drop in unsafe versions of the library. Alternately, when
|
||||
encountering crashes with code that uses unsafe fixnum operations, use
|
||||
the @schememodname[scheme/fixnum] library to help debug the problems.
|
||||
the @schememodname[racket/fixnum] library to help debug the problems.
|
||||
|
||||
@deftogether[(
|
||||
@defproc[(fx+ [a fixnum?][b fixnum?]) fixnum?]
|
||||
|
@ -1078,7 +1078,7 @@ Safe versions of @scheme[unsafe-fx=], @scheme[unsafe-fx<],
|
|||
@; ------------------------------------------------------------------------
|
||||
@section{Extra Constants and Functions}
|
||||
|
||||
@note-lib[scheme/math]
|
||||
@note-lib[racket/math]
|
||||
|
||||
@defthing[pi real]{
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/package))
|
||||
(for-label racket/package))
|
||||
|
||||
@(define pack-eval (make-base-eval))
|
||||
@interaction-eval[#:eval pack-eval (require scheme/package)]
|
||||
@interaction-eval[#:eval pack-eval (require racket/package)]
|
||||
|
||||
@title[#:tag "package"]{Limiting Scope: @scheme[define-package], @scheme[open-package], ...}
|
||||
|
||||
@note-lib-only[scheme/package]
|
||||
@note-lib-only[racket/package]
|
||||
|
||||
@deftogether[(
|
||||
@defform[(define-package package-id exports form ...)]
|
||||
|
@ -129,7 +129,7 @@ cookies
|
|||
|
||||
The @scheme[package?], @scheme[package-exported-identifiers], and
|
||||
@scheme[package-original-identifiers] functions are exported
|
||||
@scheme[for-syntax] by @schememodname[scheme/package].
|
||||
@scheme[for-syntax] by @schememodname[racket/package].
|
||||
|
||||
The @scheme[package?] predicate returns @scheme[#t] if @scheme[v] is a
|
||||
package value as obtained by @scheme[syntax-local-value] on an
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scribble/scheme
|
||||
scheme/generator
|
||||
scheme/list
|
||||
(for-syntax scheme/base))
|
||||
racket/generator
|
||||
racket/list
|
||||
(for-syntax racket/base))
|
||||
|
||||
@(define (generate-c_r-example proc)
|
||||
(define (make-it start n)
|
||||
|
@ -648,10 +648,10 @@ Like @scheme[assoc], but finds an element using the predicate
|
|||
@; ----------------------------------------
|
||||
@section{Additional List Functions and Synonyms}
|
||||
|
||||
@note-lib[scheme/list]
|
||||
@note-lib[racket/list]
|
||||
@(define list-eval (make-base-eval))
|
||||
@(interaction-eval #:eval list-eval
|
||||
(require scheme/list (only-in scheme/function negate)))
|
||||
(require racket/list (only-in racket/function negate)))
|
||||
|
||||
@defthing[empty null?]{The empty list.
|
||||
@mz-examples[#:eval list-eval
|
||||
|
|
|
@ -256,7 +256,7 @@ Windows examples.
|
|||
(build-path p2 p1)
|
||||
(code:comment @#,t{Unix and Windows: raises @scheme[exn:fail:contract]; @scheme[p1] is absolute})
|
||||
(build-path p1 p2)
|
||||
(code:comment @#,t{Unix: is @scheme["/home/joeuser/src/scheme/../../docs/Scheme"]})
|
||||
(code:comment @#,t{Unix: is @scheme["/home/joeuser/src/racket/../../docs/Scheme"]})
|
||||
(code:comment @#,t{Windows: is @scheme["C:\\Joe's Files\\src\\scheme\\..\\..\\docs\\Scheme"]})
|
||||
]}
|
||||
|
||||
|
@ -496,7 +496,7 @@ to the end.}
|
|||
@;------------------------------------------------------------------------
|
||||
@section{More Path Utilities}
|
||||
|
||||
@note-lib[scheme/path]
|
||||
@note-lib[racket/path]
|
||||
|
||||
@defproc[(explode-path [path (or/c path-string? path-for-some-system?)])
|
||||
(listof (or/c path-for-some-system? 'up 'same))]{
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/port))
|
||||
(for-label racket/port))
|
||||
|
||||
@title[#:tag "port-lib"]{More Port Constructors, Procedures, and Events}
|
||||
|
||||
@note-lib[scheme/port]
|
||||
@note-lib[racket/port]
|
||||
|
||||
@; ----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
@title[#:tag "pretty-print"]{Pretty Printing}
|
||||
|
||||
@note-lib[scheme/pretty]
|
||||
@note-lib[racket/pretty]
|
||||
|
||||
@defproc[(pretty-print [v any/c] [port output-port? (current-output-port)])
|
||||
void?]{
|
||||
|
|
|
@ -453,7 +453,7 @@ and @scheme[v2], and its result is returned by
|
|||
|
||||
A @idefterm{primitive procedure} is a built-in procedure that is
|
||||
implemented in low-level language. Not all procedures of
|
||||
@schememodname[scheme/base] are primitives, but many are. The
|
||||
@schememodname[racket/base] are primitives, but many are. The
|
||||
distinction is mainly useful to other low-level code.
|
||||
|
||||
@defproc[(primitive? [v any/c]) boolean?]{
|
||||
|
@ -479,9 +479,9 @@ applied.}
|
|||
@; ----------------------------------------
|
||||
@section{Additional Procedure Functions}
|
||||
|
||||
@note-lib[scheme/function]
|
||||
@note-lib[racket/function]
|
||||
@(define fun-eval (make-base-eval))
|
||||
@(interaction-eval #:eval fun-eval (require scheme/function))
|
||||
@(interaction-eval #:eval fun-eval (require racket/function))
|
||||
|
||||
@defproc[(const [v any]) procedure?]{
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/promise))
|
||||
(for-label racket/promise))
|
||||
|
||||
@title{Delayed Evaluation}
|
||||
|
||||
@note-lib[scheme/promise]
|
||||
@note-lib[racket/promise]
|
||||
|
||||
A @deftech{promise} encapsulates an expression to be evaluated on
|
||||
demand via @scheme[force]. After a promise has been @scheme[force]d,
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
|
||||
(module reader-example scheme/base
|
||||
(module reader-example racket/base
|
||||
(require scribble/struct
|
||||
scribble/decode
|
||||
scribble/manual
|
||||
scribble/scheme
|
||||
scheme/class)
|
||||
racket/class)
|
||||
|
||||
(provide reader-examples
|
||||
read-quote-table
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
scribble/html-properties
|
||||
scribble/latex-properties
|
||||
scribble/core
|
||||
scheme/list)
|
||||
racket/list)
|
||||
|
||||
@(define (scheme-extra-libs)
|
||||
(make-delayed-element
|
||||
|
@ -25,16 +25,16 @@
|
|||
(make-css-addition "extras.css")
|
||||
(make-tex-addition "extras.tex"))))
|
||||
|
||||
@title[#:style (extras)]{@bold{Reference}: PLT Scheme}
|
||||
@title[#:style (extras)]{@bold{Reference}: Racket}
|
||||
|
||||
@author["Matthew Flatt" "PLT"]
|
||||
|
||||
This manual defines the core PLT Scheme language and describes its
|
||||
This manual defines the core Racket language and describes its
|
||||
most prominent libraries. The companion manual @|Guide| provides a
|
||||
friendlier (though less precise and less complete) overview of the
|
||||
language.
|
||||
|
||||
@defmodulelang*[(scheme/base scheme)
|
||||
@defmodulelang*[(racket/base racket)
|
||||
;; Use sources for overlap with `mzscheme':
|
||||
#:use-sources ('#%kernel
|
||||
racket/private/more-scheme
|
||||
|
@ -44,14 +44,15 @@ language.
|
|||
racket/private/letstx-scheme
|
||||
racket/private/define
|
||||
racket/private/stx
|
||||
racket/private/map)]{
|
||||
racket/private/map
|
||||
racket/private/base)]{
|
||||
|
||||
Unless otherwise noted, the bindings defined in this manual are
|
||||
exported by the @schememodname[scheme/base] and @schememodname[scheme]
|
||||
exported by the @schememodname[racket/base] and @schememodname[racket]
|
||||
languages.}
|
||||
|
||||
@margin-note{The @schememodname[scheme] library combines
|
||||
@schememodname[scheme/base]@scheme-extra-libs[].}
|
||||
@margin-note{The @schememodname[racket] library combines
|
||||
@schememodname[racket/base]@scheme-extra-libs[].}
|
||||
|
||||
@table-of-contents[]
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
@(require "mz.ss"
|
||||
scheme/sandbox
|
||||
(for-label scheme/sandbox
|
||||
scheme/port
|
||||
(only-in scheme/gui make-gui-namespace)
|
||||
scheme/gui/dynamic))
|
||||
racket/port
|
||||
(only-in racket/gui make-gui-namespace)
|
||||
racket/gui/dynamic))
|
||||
|
||||
@(define box-eval (make-base-eval))
|
||||
@(interaction-eval #:eval box-eval (require scheme/sandbox))
|
||||
|
@ -138,9 +138,9 @@ top-level namespace:
|
|||
#:eval box-eval
|
||||
(define base-module-eval
|
||||
(code:comment @#,t{a module cannot have free variables...})
|
||||
(make-evaluator 'scheme/base '(define (f) later)))
|
||||
(make-evaluator 'racket/base '(define (f) later)))
|
||||
(define base-module-eval
|
||||
(make-evaluator 'scheme/base '(define (f) later)
|
||||
(make-evaluator 'racket/base '(define (f) later)
|
||||
'(define later 5)))
|
||||
(base-module-eval '(f))
|
||||
|
||||
|
@ -163,7 +163,7 @@ restriction is enforced).
|
|||
@schemeblock[
|
||||
(define base-module-eval2
|
||||
(code:comment @#,t{equivalent to @scheme[base-module-eval]:})
|
||||
(make-module-evaluator '(module m scheme/base
|
||||
(make-module-evaluator '(module m racket/base
|
||||
(define (f) later)
|
||||
(define later 5))))
|
||||
]
|
||||
|
@ -201,7 +201,7 @@ calls to a single evaluator. Usually this is not a problem, but in
|
|||
some cases you can get the evaluator function available inside the
|
||||
sandboxed code, for example:
|
||||
@schemeblock[
|
||||
(let ([e (make-evaluator 'scheme/base)])
|
||||
(let ([e (make-evaluator 'racket/base)])
|
||||
(e (,e 1)))
|
||||
]
|
||||
An error will be signalled in such cases.
|
||||
|
@ -220,7 +220,7 @@ that you can easily start a sandboxed read-eval-print-loop. For
|
|||
example, here is a quick implementation of a networked REPL:
|
||||
|
||||
@schemeblock[
|
||||
(define e (make-evaluator 'scheme/base))
|
||||
(define e (make-evaluator 'racket/base))
|
||||
(let-values ([(i o) (tcp-accept (tcp-listen 9999))])
|
||||
(parameterize ([current-input-port i]
|
||||
[current-output-port o]
|
||||
|
@ -250,7 +250,7 @@ used from a module (by using a new namespace):
|
|||
[sandbox-error-output o]
|
||||
[current-namespace (make-empty-namespace)])
|
||||
(parameterize ([current-eval
|
||||
(make-evaluator 'scheme/base)])
|
||||
(make-evaluator 'racket/base)])
|
||||
(read-eval-print-loop))
|
||||
(fprintf o "\nBye...\n")
|
||||
(close-output-port o)))
|
||||
|
@ -571,7 +571,7 @@ with the per-expression limit specified by
|
|||
sandbox, as well as from the interaction will count against the
|
||||
sandbox limit. For example, in the last interaction of this code,
|
||||
@schemeblock[
|
||||
(define e (make-evaluator 'scheme/base))
|
||||
(define e (make-evaluator 'racket/base))
|
||||
(e '(define a 1))
|
||||
(e '(for ([i (in-range 20)]) (set! a (cons (make-bytes 500000) a))))
|
||||
]
|
||||
|
@ -598,11 +598,11 @@ per-evaluation limits (useful in case more limit kinds are available
|
|||
in future versions). The default is @scheme[(list 30 20)].
|
||||
|
||||
Note that these limits apply to the creation of the sandbox
|
||||
environment too --- even @scheme[(make-evaluator 'scheme/base)] can
|
||||
environment too --- even @scheme[(make-evaluator 'racket/base)] can
|
||||
fail if the limits are strict enough. For example,
|
||||
@schemeblock[
|
||||
(parameterize ([sandbox-eval-limits '(0.25 5)])
|
||||
(make-evaluator 'scheme/base '(sleep 2)))
|
||||
(make-evaluator 'racket/base '(sleep 2)))
|
||||
]
|
||||
will throw an error instead of creating an evaluator. Therefore, to
|
||||
avoid surprises you need to catch errors that happen when the sandbox
|
||||
|
@ -878,7 +878,7 @@ your own permissions, for example,
|
|||
|
||||
@defthing[gui? boolean?]{
|
||||
|
||||
True if the @schememodname[scheme/gui] module can be used, @scheme[#f]
|
||||
True if the @schememodname[racket/gui] module can be used, @scheme[#f]
|
||||
otherwise; see @scheme[gui-available?].
|
||||
|
||||
Various aspects of the @schememodname[scheme/sandbox] library change
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-syntax scheme/base)
|
||||
(for-syntax racket/base)
|
||||
scribble/scheme
|
||||
(for-label scheme/generator))
|
||||
(for-label racket/generator))
|
||||
|
||||
@(define generator-eval
|
||||
(lambda ()
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require scheme/generator))
|
||||
(the-eval '(require racket/generator))
|
||||
the-eval)))
|
||||
|
||||
@(define (info-on-seq where what)
|
||||
|
@ -324,7 +324,7 @@ sequence; if no more elements are available, the
|
|||
@exnraise[exn:fail:contract].}
|
||||
|
||||
@section{Iterator Generators}
|
||||
@defmodule[scheme/generator]
|
||||
@defmodule[racket/generator]
|
||||
@defform[(generator () body ...)]{ Creates a function that returns a
|
||||
value through @scheme[yield], each time it is invoked. When
|
||||
the generator runs out of values to yield, the last value it computed
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scheme/serialize
|
||||
(for-label scheme/serialize))
|
||||
racket/serialize
|
||||
(for-label racket/serialize))
|
||||
|
||||
@(define ser-eval (make-base-eval))
|
||||
@(interaction-eval #:eval ser-eval (require scheme/serialize))
|
||||
@(interaction-eval #:eval ser-eval (require racket/serialize))
|
||||
|
||||
@title[#:tag "serialization"]{Serialization}
|
||||
|
||||
@note-lib-only[scheme/serialize #:use-sources (racket/private/serialize)]
|
||||
@note-lib-only[racket/serialize #:use-sources (racket/private/serialize)]
|
||||
|
||||
@defproc[(serializable? [v any/c]) boolean?]{
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/set))
|
||||
(for-label racket/set))
|
||||
|
||||
@title[#:tag "sets"]{Sets}
|
||||
|
||||
|
@ -16,7 +16,7 @@ unpredictable in much the same way that @tech{hash table} operations are
|
|||
unpredictable when keys are mutated.
|
||||
|
||||
|
||||
@note-lib-only[scheme/set]
|
||||
@note-lib[racket/set]
|
||||
|
||||
@defproc[(set? [v any/c]) boolean?]{
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scribble/struct
|
||||
scheme/shared
|
||||
(for-label scheme/shared))
|
||||
racket/shared
|
||||
(for-label racket/shared))
|
||||
|
||||
|
||||
@(define shared-eval (make-base-eval))
|
||||
@(interaction-eval #:eval shared-eval (require scheme/shared))
|
||||
@(interaction-eval #:eval shared-eval (require racket/shared))
|
||||
|
||||
@(define maker
|
||||
(make-element #f (list
|
||||
|
@ -20,7 +20,7 @@
|
|||
|
||||
@title[#:tag "shared"]{Constructing Graphs: @scheme[shared]}
|
||||
|
||||
@note-lib[scheme/shared]
|
||||
@note-lib[racket/shared]
|
||||
|
||||
@defform[(shared ([id expr] ...) body ...+)]{
|
||||
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/splicing
|
||||
scheme/stxparam
|
||||
scheme/local))
|
||||
(for-label racket/splicing
|
||||
racket/stxparam
|
||||
racket/local))
|
||||
|
||||
@(define splice-eval (make-base-eval))
|
||||
@interaction-eval[#:eval splice-eval (require scheme/splicing
|
||||
scheme/stxparam
|
||||
(for-syntax scheme/base))]
|
||||
@interaction-eval[#:eval splice-eval (require racket/splicing
|
||||
racket/stxparam
|
||||
(for-syntax racket/base))]
|
||||
|
||||
@title[#:tag "splicing"]{Local Binding with Splicing Body}
|
||||
|
||||
@note-lib-only[scheme/splicing]
|
||||
@note-lib-only[racket/splicing]
|
||||
|
||||
@deftogether[(
|
||||
@defidform[splicing-let]
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
scribble/bnf
|
||||
(for-label scheme/pretty
|
||||
scheme/gui/base))
|
||||
(for-label racket/pretty
|
||||
racket/gui/base))
|
||||
|
||||
@(define (FlagFirst n) (as-index (Flag n)))
|
||||
@(define (DFlagFirst n) (as-index (DFlag n)))
|
||||
|
@ -21,13 +21,13 @@ The core PLT Scheme run-time system is available in two main variants:
|
|||
@itemize[
|
||||
|
||||
@item{MzScheme, which provides the primitives libraries on which
|
||||
@schememodname[scheme/base] is implemented. Under Unix and Mac
|
||||
@schememodname[racket/base] is implemented. Under Unix and Mac
|
||||
OS X, the executable is called
|
||||
@as-index{@exec{mzscheme}}. Under Windows, the executable is
|
||||
called @as-index{@exec{MzScheme.exe}}.}
|
||||
|
||||
@item{MrEd, which extends @exec{mzscheme} with GUI primitives on
|
||||
which @schememodname[scheme/gui/base] is implemented. Under
|
||||
which @schememodname[racket/gui/base] is implemented. Under
|
||||
Unix, the executable is called @as-index{@exec{mred}}. Under
|
||||
Windows, the executable is called
|
||||
@as-index{@exec{MrEd.exe}}. Under Mac OS X, the @exec{mred}
|
||||
|
@ -44,8 +44,8 @@ On startup, the top-level environment contains no bindings---not even
|
|||
that start with @schemeidfont{#%} are defined, but they are not meant
|
||||
for direct use, and the set of such modules can change. For example,
|
||||
the @indexed-scheme['#%kernel] module is eventually used to bootstrap
|
||||
the implemetation of @schememodname[scheme/base], and
|
||||
@scheme['#%mred-kernel] is used for @schememodname[scheme/gui/base].
|
||||
the implemetation of @schememodname[racket/base], and
|
||||
@scheme['#%mred-kernel] is used for @schememodname[racket/gui/base].
|
||||
|
||||
The first action of MzScheme or MrEd is to initialize
|
||||
@scheme[current-library-collection-paths] to the result of
|
||||
|
@ -55,8 +55,8 @@ are extra directory paths provided in order in the command line with
|
|||
@Flag{S}/@DFlag{search}. An executable created from the MzScheme or
|
||||
MrEd executable can embed paths used as @scheme[_pre-extras].
|
||||
|
||||
MzScheme and MrEd next @scheme[require] @schememodname[scheme/init]
|
||||
and @schememodname[scheme/gui/init], respectively, but only if the
|
||||
MzScheme and MrEd next @scheme[require] @schememodname[racket/init]
|
||||
and @schememodname[racket/gui/init], respectively, but only if the
|
||||
command line does not specify a @scheme[require] flag
|
||||
(@Flag{t}/@DFlag{require}, @Flag{l}/@DFlag{lib}, or
|
||||
@Flag{u}/@DFlag{require-script}) before any @scheme[eval],
|
||||
|
@ -199,8 +199,8 @@ flags:
|
|||
instead of @scheme[graphical-read-eval-print-loop].}
|
||||
|
||||
@item{@FlagFirst{n} or @DFlagFirst{no-lib} : Skips requiring the
|
||||
initialization library (i.e., @schememodname[scheme/init] or
|
||||
@schememodname[scheme/gui/init], unless it is changed with the
|
||||
initialization library (i.e., @schememodname[racket/init] or
|
||||
@schememodname[racket/gui/init], unless it is changed with the
|
||||
@Flag{I} flag) when not otherwise disabled.}
|
||||
|
||||
@item{@FlagFirst{v} or @DFlagFirst{version} : Shows
|
||||
|
@ -399,7 +399,7 @@ language specifies run-time configuration by
|
|||
|
||||
]
|
||||
|
||||
The @schememodname[scheme/base] and @schememodname[scheme] languages
|
||||
The @schememodname[racket/base] and @schememodname[scheme] languages
|
||||
do not currently specify a run-time configuration action.
|
||||
|
||||
A @scheme['configure-runtime] query returns a list of vectors, instead
|
||||
|
|
|
@ -364,9 +364,9 @@ allocated string).}
|
|||
@; ----------------------------------------
|
||||
@section{Additional String Functions}
|
||||
|
||||
@note-lib[scheme/string]
|
||||
@note-lib[racket/string]
|
||||
@(define string-eval (make-base-eval))
|
||||
@(interaction-eval #:eval string-eval (require scheme/string scheme/list))
|
||||
@(interaction-eval #:eval string-eval (require racket/string racket/list))
|
||||
|
||||
@defproc[(string-append* [str string?] ... [strs (listof string?)]) string?]{
|
||||
@; Note: this is exactly the same description as the one for append*
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/struct-info))
|
||||
(for-label racket/struct-info))
|
||||
|
||||
@(define struct-eval (make-base-eval))
|
||||
|
||||
|
@ -628,7 +628,7 @@ imported structure type, in which case the user is expected to know
|
|||
the set of fields that are listed in the signature for the structure
|
||||
type.
|
||||
|
||||
@note-lib-only[scheme/struct-info]
|
||||
@note-lib-only[racket/struct-info]
|
||||
|
||||
@defproc[(struct-info? [v any/c]) boolean?]{
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
#lang scribble/doc
|
||||
@(require "mz.ss"
|
||||
(for-label scheme/stxparam
|
||||
scheme/stxparam-exptime
|
||||
scheme/splicing))
|
||||
(for-label racket/stxparam
|
||||
racket/stxparam-exptime
|
||||
racket/splicing))
|
||||
|
||||
@title[#:tag "stxparam"]{Syntax Parameters}
|
||||
|
||||
@note-lib-only[scheme/stxparam]
|
||||
@note-lib-only[racket/stxparam]
|
||||
|
||||
@defform[(define-syntax-parameter id expr)]{
|
||||
|
||||
|
@ -49,9 +49,9 @@ the target's value.}
|
|||
|
||||
@section{Syntax Parameter Inspection}
|
||||
|
||||
@defmodule*/no-declare[(scheme/stxparam-exptime)]
|
||||
@defmodule*/no-declare[(racket/stxparam-exptime)]
|
||||
|
||||
@declare-exporting[scheme/stxparam-exptime scheme/stxparam]
|
||||
@declare-exporting[racket/stxparam-exptime racket/stxparam]
|
||||
|
||||
@defproc[(syntax-parameter-value [id-stx syntax?]) any]{
|
||||
|
||||
|
@ -62,9 +62,9 @@ value of the @tech{syntax parameter}, as adjusted by
|
|||
@scheme[syntax-parameterize] form.
|
||||
|
||||
This binding is provided @scheme[for-syntax] by
|
||||
@schememodname[scheme/stxparam], since it is normally used in a
|
||||
@schememodname[racket/stxparam], since it is normally used in a
|
||||
transformer. It is provided normally by
|
||||
@schememodname[scheme/stxparam-exptime].}
|
||||
@schememodname[racket/stxparam-exptime].}
|
||||
|
||||
|
||||
@defproc[(make-parameter-rename-transformer [id-stx syntax?]) any]{
|
||||
|
@ -87,6 +87,6 @@ treated specially by @scheme[syntax-local-value], unlike the result
|
|||
of @scheme[make-rename-transformer].
|
||||
|
||||
This binding is provided @scheme[for-syntax] by
|
||||
@schememodname[scheme/stxparam], since it is normally used in a
|
||||
@schememodname[racket/stxparam], since it is normally used in a
|
||||
transformer. It is provided normally by
|
||||
@schememodname[scheme/stxparam-exptime].}
|
||||
@schememodname[racket/stxparam-exptime].}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
@(define syntax-eval
|
||||
(lambda ()
|
||||
(let ([the-eval (make-base-eval)])
|
||||
(the-eval '(require (for-syntax scheme/base)))
|
||||
(the-eval '(require (for-syntax racket/base)))
|
||||
the-eval)))
|
||||
|
||||
@title[#:tag "stx-patterns"]{Pattern-Based Syntax Matching}
|
||||
|
@ -80,9 +80,9 @@ A syntax object matches a @scheme[pattern] as follows:
|
|||
|
||||
@specsubform[(pattern ...+ . pattern)]{
|
||||
|
||||
The last @scheme[pattern] must not be a @scheme/form[(pattern ...)],
|
||||
@scheme/form[(pattern ...+ . pattern)], @scheme/form[(pattern ... pattern
|
||||
ellipses pattern ...)], or @scheme/form[(pattern ... pattern ellipses
|
||||
The last @scheme[pattern] must not be a @racket/form[(pattern ...)],
|
||||
@racket/form[(pattern ...+ . pattern)], @racket/form[(pattern ... pattern
|
||||
ellipses pattern ...)], or @racket/form[(pattern ... pattern ellipses
|
||||
pattern ... . pattern)] form.
|
||||
|
||||
Like the previous kind of pattern, but matches syntax objects that
|
||||
|
@ -155,7 +155,7 @@ A syntax object matches a @scheme[pattern] as follows:
|
|||
@scheme[const].}
|
||||
|
||||
@mz-examples[
|
||||
(require (for-syntax scheme/base))
|
||||
(require (for-syntax racket/base))
|
||||
(define-syntax (swap stx)
|
||||
(syntax-case stx ()
|
||||
[(_ a b) #'(let ([t a])
|
||||
|
@ -490,4 +490,4 @@ get the identifier's transformer value, and then test the value with
|
|||
@scheme[syntax-pattern-variable?].
|
||||
|
||||
The @scheme[syntax-pattern-variable?] procedure is provided
|
||||
@scheme[for-syntax] by @schememodname[scheme/base].}
|
||||
@scheme[for-syntax] by @schememodname[racket/base].}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user