From 909f43f9a23d2d51296ef52635beae7e36f43210 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 22 Apr 2010 20:18:53 -0600 Subject: [PATCH 01/12] work on racketing reference --- collects/scribble/racket.ss | 985 +++++++++++ collects/scribble/scheme.ss | 988 +---------- .../scribblings/main/getting-started.scrbl | 7 +- .../scribblings/reference/eval-model.scrbl | 286 ++-- collects/scribblings/reference/prog-steps.ss | 2 +- .../scribblings/reference/syntax-model.scrbl | 422 ++--- collects/scribblings/reference/syntax.scrbl | 1517 ++++++++--------- 7 files changed, 2103 insertions(+), 2104 deletions(-) create mode 100644 collects/scribble/racket.ss diff --git a/collects/scribble/racket.ss b/collects/scribble/racket.ss new file mode 100644 index 0000000000..977a38e7cd --- /dev/null +++ b/collects/scribble/racket.ss @@ -0,0 +1,985 @@ +(module racket racket/base + (require "core.ss" + "basic.ss" + "search.ss" + "private/manual-sprop.ss" + "private/on-demand.ss" + mzlib/class + mzlib/for + syntax/modresolve + syntax/modcode + (for-syntax racket/base)) + + (provide define-code + to-element + to-element/no-color + to-paragraph + to-paragraph/prefix + syntax-ize + syntax-ize-hook + current-keyword-list + current-variable-list + current-meta-list + + input-color + output-color + input-background-color + no-color + reader-color + result-color + keyword-color + comment-color + paren-color + meta-color + value-color + symbol-color + variable-color + opt-color + error-color + syntax-link-color + value-link-color + module-color + module-link-color + block-color + highlighted-color + + (struct-out var-id) + (struct-out shaped-parens) + (struct-out just-context) + (struct-out alternate-display) + (struct-out literal-syntax) + (for-syntax make-variable-id + variable-id? + make-element-id-transformer + element-id-transformer?)) + + (define (make-racket-style s #:tt? [tt? #t]) + (make-style s (if tt? + (cons 'tt-chars scheme-properties) + scheme-properties))) + + (define-on-demand output-color (make-racket-style "ScmOut")) + (define-on-demand input-color (make-racket-style "ScmIn")) + (define-on-demand input-background-color (make-racket-style "ScmInBG")) + (define-on-demand no-color (make-racket-style "ScmPlain")) + (define-on-demand reader-color (make-racket-style "ScmRdr")) + (define-on-demand result-color (make-racket-style "ScmRes")) + (define-on-demand keyword-color (make-racket-style "ScmKw")) + (define-on-demand comment-color (make-racket-style "ScmCmt")) + (define-on-demand paren-color (make-racket-style "ScmPn")) + (define-on-demand meta-color (make-racket-style "ScmMeta")) + (define-on-demand value-color (make-racket-style "ScmVal")) + (define-on-demand symbol-color (make-racket-style "ScmSym")) + (define-on-demand variable-color (make-racket-style "ScmVar")) + (define-on-demand opt-color (make-racket-style "ScmOpt")) + (define-on-demand error-color (make-racket-style "ScmErr" #:tt? #f)) + (define-on-demand syntax-link-color (make-racket-style "ScmStxLink")) + (define-on-demand value-link-color (make-racket-style "ScmValLink")) + (define-on-demand module-color (make-racket-style "ScmMod")) + (define-on-demand module-link-color (make-racket-style "ScmModLink")) + (define-on-demand block-color (make-racket-style "ScmBlk")) + (define-on-demand highlighted-color (make-racket-style "highlighted" #:tt? #f)) + + (define current-keyword-list + (make-parameter null)) + (define current-variable-list + (make-parameter null)) + (define current-meta-list + (make-parameter null)) + + (define defined-names (make-hasheq)) + + (define-struct (sized-element element) (length)) + + (define-struct (spaces element) (cnt)) + + (define (literalize-spaces i) + (let ([m (regexp-match-positions #rx" +" i)]) + (if m + (let ([cnt (- (cdar m) (caar m))]) + (make-spaces #f + (list + (literalize-spaces (substring i 0 (caar m))) + (hspace cnt) + (literalize-spaces (substring i (cdar m)))) + cnt)) + i))) + + + (define line-breakable-space (make-element 'tt " ")) + + ;; These caches intentionally record a key with the value. + ;; That way, when the value is no longer used, the key + ;; goes away, and the entry is gone. + + (define id-element-cache (make-weak-hash)) + (define element-cache (make-weak-hash)) + + (define-struct (cached-delayed-element delayed-element) (cache-key)) + (define-struct (cached-element element) (cache-key)) + + (define (make-id-element c s) + (let* ([key (and id-element-cache + (let ([b (identifier-label-binding c)]) + (vector (syntax-e c) + (module-path-index->taglet (caddr b)) + (cadddr b) + (list-ref b 5))))]) + (or (and key + (let ([b (hash-ref id-element-cache key #f)]) + (and b + (weak-box-value b)))) + (let ([e (make-cached-delayed-element + (lambda (renderer sec ri) + (let* ([tag (find-racket-tag sec ri c #f)]) + (if tag + (list + (case (car tag) + [(form) + (make-link-element syntax-link-color (list s) tag)] + [else + (make-link-element value-link-color (list s) tag)])) + (list + (make-element "badlink" + (make-element value-link-color s)))))) + (lambda () s) + (lambda () s) + key)]) + (when key + (hash-set! id-element-cache key (make-weak-box e))) + e)))) + + (define (make-element/cache style content) + (if (and element-cache + (string? content)) + (let ([key (vector style content)]) + (let ([b (hash-ref element-cache key #f)]) + (or (and b (weak-box-value b)) + (let ([e (make-cached-element style content key)]) + (hash-set! element-cache key (make-weak-box e)) + e)))) + (make-element style content))) + + (define (to-quoted qs qq? quote-depth out color? inc!) + (if (and qq? (zero? quote-depth)) + (begin + (out qs (and color? value-color)) + (inc!) + (add1 quote-depth)) + quote-depth)) + + (define (to-unquoted qq? quote-depth out color? inc!) + (if (or (not qq?) (zero? quote-depth)) + quote-depth + (begin + (out "," (and color? meta-color)) + (inc!) + (to-unquoted qq? (sub1 quote-depth) out color? inc!)))) + + (define (typeset-atom c out color? quote-depth qq?) + (if (and (var-id? (syntax-e c)) + (zero? quote-depth)) + (out (format "~s" (let ([v (var-id-sym (syntax-e c))]) + (if (syntax? v) + (syntax-e v) + v))) + variable-color) + (let*-values ([(is-var?) (and (identifier? c) + (memq (syntax-e c) (current-variable-list)))] + [(s it? sub?) + (let ([sc (syntax-e c)]) + (let ([s (or (syntax-property c 'display-string) + (format "~s" (if (literal-syntax? sc) + (literal-syntax-stx sc) + (if (var-id? sc) + (var-id-sym sc) + sc))))]) + (if (and (symbol? sc) + ((string-length s) . > . 1) + (char=? (string-ref s 0) #\_) + (not (or (identifier-label-binding c) + is-var?))) + (values (substring s 1) #t #f) + (values s #f #f))))]) + (let ([quote-depth (if (and qq? (identifier? c)) + (let ([quote-depth + (if (and (quote-depth . < . 2) + (memq (syntax-e c) '(unquote unquote-splicing))) + (to-unquoted qq? quote-depth out color? void) + quote-depth)]) + (to-quoted "'" qq? quote-depth out color? void)) + quote-depth)]) + (if (or (element? (syntax-e c)) + (delayed-element? (syntax-e c)) + (part-relative-element? (syntax-e c))) + (out (syntax-e c) #f) + (out (if (and (identifier? c) + color? + (quote-depth . <= . 0) + (not (or it? is-var?))) + (if (pair? (identifier-label-binding c)) + (make-id-element c s) + s) + (literalize-spaces s)) + (cond + [(positive? quote-depth) value-color] + [(let ([v (syntax-e c)]) + (or (number? v) + (string? v) + (bytes? v) + (char? v) + (regexp? v) + (byte-regexp? v) + (boolean? v))) + value-color] + [(identifier? c) + (cond + [is-var? + variable-color] + [(and (identifier? c) + (memq (syntax-e c) (current-keyword-list))) + keyword-color] + [(and (identifier? c) + (memq (syntax-e c) (current-meta-list))) + meta-color] + [it? variable-color] + [else symbol-color])] + [else paren-color]) + (string-length s))))))) + + (define omitable (make-style #f '(omitable))) + + (define (gen-typeset c multi-line? prefix1 prefix suffix color? qq?) + (let* ([c (syntax-ize c 0 #:qq? qq?)] + [content null] + [docs null] + [first (syntax-case c (code:line) + [(code:line e . rest) #'e] + [else c])] + [init-col (or (syntax-column first) 0)] + [src-col init-col] + [inc-src-col (lambda () (set! src-col (add1 src-col)))] + [dest-col 0] + [highlight? #f] + [col-map (make-hash)] + [next-col-map (make-hash)] + [line (or (syntax-line first) 0)]) + (define (finish-line!) + (when multi-line? + (set! docs (cons (make-paragraph omitable (reverse content)) + docs)) + (set! content null))) + (define out + (case-lambda + [(v cls) + (out v cls (let sz-loop ([v v]) + (cond + [(string? v) (string-length v)] + [(list? v) (for/fold ([s 0]) ([v (in-list v)]) (+ s (sz-loop v)))] + [(sized-element? v) (sized-element-length v)] + [(element? v) + (sz-loop (element-content v))] + [(delayed-element? v) + (content-width v)] + [(part-relative-element? v) + (content-width v)] + [(spaces? v) + (+ (sz-loop (car (element-content v))) + (spaces-cnt v) + (sz-loop (caddr (element-content v))))] + [else 1])))] + [(v cls len) + (unless (equal? v "") + (cond + [(spaces? v) + (out (car (element-content v)) cls 0) + (out (cadr (element-content v)) #f 0) + (out (caddr (element-content v)) cls len)] + [(equal? v "\n") + (if multi-line? + (begin + (finish-line!) + (out prefix cls)) + (out " " cls))] + [else + (set! content (cons ((if highlight? + (lambda (c) + (make-element highlighted-color c)) + values) + (if (and color? cls) + (make-element/cache cls v) + v)) + content)) + (set! dest-col (+ dest-col len))]))])) + (define advance + (case-lambda + [(c init-line! delta) + (let ([c (+ delta (or (syntax-column c) 0))] + [l (syntax-line c)]) + (let ([new-line? (and l (l . > . line))]) + (when new-line? + (for ([i (in-range (- l line))]) + (out "\n" no-color)) + (set! line l) + (set! col-map next-col-map) + (set! next-col-map (make-hash)) + (init-line!)) + (let ([d-col (let ([def-val (+ dest-col (- c src-col))]) + (if new-line? + (hash-ref col-map c def-val) + def-val))]) + (let ([amt (- d-col dest-col)]) + (when (positive? amt) + (let ([old-dest-col dest-col]) + (out (if (and (= 1 amt) (not multi-line?)) + line-breakable-space ; allows a line break to replace the space + (hspace amt)) + #f) + (set! dest-col (+ old-dest-col amt)))))) + (set! src-col c) + (hash-set! next-col-map src-col dest-col)))] + [(c init-line!) (advance c init-line! 0)])) + (define (convert-infix c quote-depth qq?) + (let ([l (syntax->list c)]) + (and l + ((length l) . >= . 3) + ((or (syntax-position (car l)) -inf.0) + . > . + (or (syntax-position (cadr l)) +inf.0)) + (let ([a (car l)]) + (let loop ([l (cdr l)] + [prev null]) + (cond + [(null? l) #f] ; couldn't unwind + [else (let ([p2 (syntax-position (car l))]) + (if (and p2 + (p2 . > . (syntax-position a))) + (datum->syntax c + (append + (reverse prev) + (list + (datum->syntax + a + (let ([val? (positive? quote-depth)]) + (make-sized-element + (if val? value-color #f) + (list + (make-element/cache (if val? value-color paren-color) '". ") + (typeset a #f "" "" "" (not val?) qq?) + (make-element/cache (if val? value-color paren-color) '" .")) + (+ (syntax-span a) 4))) + (list (syntax-source a) + (syntax-line a) + (- (syntax-column a) 2) + (- (syntax-position a) 2) + (+ (syntax-span a) 4)) + a)) + l) + c + c) + (loop (cdr l) + (cons (car l) prev))))])))))) + (define (no-fancy-chars s) + (cond + [(eq? s 'rsquo) "'"] + [else s])) + (define (loop init-line! quote-depth qq?) + (lambda (c) + (cond + [(eq? 'code:blank (syntax-e c)) + (advance c init-line!)] + [(and (pair? (syntax-e c)) + (eq? (syntax-e (car (syntax-e c))) 'code:comment)) + (let ([l (syntax->list c)]) + (unless (and l (= 2 (length l))) + (raise-syntax-error + #f + "does not have a single sub-form" + c))) + (advance c init-line!) + (out ";" comment-color) + (out 'nbsp comment-color) + (let ([v (syntax->datum (cadr (syntax->list c)))]) + (if (paragraph? v) + (map (lambda (v) + (let ([v (no-fancy-chars v)]) + (if (or (string? v) (symbol? v)) + (out v comment-color) + (out v #f)))) + (paragraph-content v)) + (out (no-fancy-chars v) comment-color)))] + [(and (pair? (syntax-e c)) + (eq? (syntax-e (car (syntax-e c))) 'code:contract)) + (advance c init-line!) + (out "; " comment-color) + (let* ([l (cdr (syntax->list c))] + [s-col (or (syntax-column (car l)) src-col)]) + (set! src-col s-col) + (for-each (loop (lambda () + (set! src-col s-col) + (set! dest-col 0) + (out "; " comment-color)) + 0 + qq?) + l))] + [(and (pair? (syntax-e c)) + (eq? (syntax-e (car (syntax-e c))) 'code:line)) + (let ([l (cdr (syntax->list c))]) + (for-each (loop init-line! quote-depth qq?) + l))] + [(and (pair? (syntax-e c)) + (eq? (syntax-e (car (syntax-e c))) 'code:hilite)) + (let ([l (syntax->list c)] + [h? highlight?]) + (unless (and l (= 2 (length l))) + (error "bad code:redex: ~e" (syntax->datum c))) + (advance c init-line!) + (set! src-col (syntax-column (cadr l))) + (hash-set! next-col-map src-col dest-col) + (set! highlight? #t) + ((loop init-line! quote-depth qq?) (cadr l)) + (set! highlight? h?) + (set! src-col (add1 src-col)))] + [(and (pair? (syntax-e c)) + (eq? (syntax-e (car (syntax-e c))) 'code:quote)) + (advance c init-line!) + (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) + (out "(" (if (positive? quote-depth) value-color paren-color)) + (set! src-col (+ src-col 1)) + (hash-set! next-col-map src-col dest-col) + ((loop init-line! quote-depth qq?) + (datum->syntax #'here 'quote (car (syntax-e c)))) + (for-each (loop init-line! (add1 quote-depth) qq?) + (cdr (syntax->list c))) + (out ")" (if (positive? quote-depth) value-color paren-color)) + (set! src-col (+ src-col 1)) + #; + (hash-set! next-col-map src-col dest-col))] + [(and (pair? (syntax-e c)) + (memq (syntax-e (car (syntax-e c))) + '(quote quasiquote unquote unquote-splicing + quasisyntax syntax unsyntax unsyntax-splicing)) + (let ([v (syntax->list c)]) + (and v (= 2 (length v)))) + (or (not qq?) + (quote-depth . > . 1) + (not (memq (syntax-e (car (syntax-e c))) + '(unquote unquote-splicing))))) + (advance c init-line!) + (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) + (let-values ([(str quote-delta) + (case (syntax-e (car (syntax-e c))) + [(quote) (values "'" +inf.0)] + [(unquote) (values "," -1)] + [(unquote-splicing) (values ",@" -1)] + [(quasiquote) (values "`" +1)] + [(syntax) (values "#'" 0)] + [(quasisyntax) (values "#`" 0)] + [(unsyntax) (values "#," 0)] + [(unsyntax-splicing) (values "#,@" 0)])]) + (out str (if (positive? (+ quote-depth quote-delta)) + value-color + reader-color)) + (let ([i (cadr (syntax->list c))]) + (set! src-col (or (syntax-column i) src-col)) + (hash-set! next-col-map src-col dest-col) + ((loop init-line! (+ quote-depth quote-delta) qq?) i))))] + [(and (pair? (syntax-e c)) + (convert-infix c quote-depth qq?)) + => (lambda (converted) + ((loop init-line! quote-depth qq?) converted))] + [(or (pair? (syntax-e c)) + (null? (syntax-e c)) + (vector? (syntax-e c)) + (and (struct? (syntax-e c)) + (prefab-struct-key (syntax-e c))) + (struct-proxy? (syntax-e c))) + (let* ([sh (or (syntax-property c 'paren-shape) + #\()] + [quote-depth (if (and (not qq?) + (zero? quote-depth) + (or (vector? (syntax-e c)) + (struct? (syntax-e c)))) + +inf.0 + quote-depth)] + [p-color (if (positive? quote-depth) + value-color + (if (eq? sh #\?) + opt-color + paren-color))]) + (advance c init-line!) + (let ([quote-depth (if (struct-proxy? (syntax-e c)) + (to-unquoted qq? quote-depth out color? inc-src-col) + (to-quoted "`" qq? quote-depth out color? inc-src-col))]) + (when (vector? (syntax-e c)) + (let ([vec (syntax-e c)]) + (out "#" #;(format "#~a" (vector-length vec)) p-color) + (if (zero? (vector-length vec)) + (set! src-col (+ src-col (- (syntax-span c) 2))) + (set! src-col (+ src-col (- (syntax-column (vector-ref vec 0)) + (syntax-column c) + 1)))))) + (when (struct? (syntax-e c)) + (out "#s" p-color) + (set! src-col (+ src-col 2))) + (out (case sh + [(#\[ #\?) "["] + [(#\{) "{"] + [else "("]) + p-color) + (set! src-col (+ src-col 1)) + (hash-set! next-col-map src-col dest-col) + (let lloop ([l (cond + [(vector? (syntax-e c)) + (vector->short-list (syntax-e c) syntax-e)] + [(struct? (syntax-e c)) + (let ([l (vector->list (struct->vector (syntax-e c)))]) + ;; Need to build key datum, syntax-ize it internally, and + ;; set the overall width to fit right: + (cons (let ([key (syntax-ize (prefab-struct-key (syntax-e c)) + (+ 3 (or (syntax-column c) 0)) + (or (syntax-line c) 1))] + [end (if (pair? (cdr l)) + (and (equal? (syntax-line c) (syntax-line (cadr l))) + (syntax-column (cadr l))) + (and (syntax-column c) + (+ (syntax-column c) (syntax-span c))))]) + (if end + (datum->syntax #f + (syntax-e key) + (vector #f (syntax-line key) + (syntax-column key) + (syntax-position key) + (- end 1 (syntax-column key)))) + end)) + (cdr l)))] + [(struct-proxy? (syntax-e c)) + (cons + (struct-proxy-name (syntax-e c)) + (struct-proxy-content (syntax-e c)))] + [else c])] + [first-qq? (and qq? (not (struct-proxy? (syntax-e c))))]) + (cond + [(and (syntax? l) + (pair? (syntax-e l)) + (not (and (memq (syntax-e (car (syntax-e l))) + '(quote unquote syntax unsyntax quasiquote quasiunsyntax)) + (let ([v (syntax->list l)]) + (and v (= 2 (length v)))) + (or (not qq?) + (quote-depth . > . 1) + (not (memq (syntax-e (car (syntax-e l))) + '(unquote unquote-splicing))))))) + (lloop (syntax-e l) first-qq?)] + [(or (null? l) + (and (syntax? l) + (null? (syntax-e l)))) + (void)] + [(pair? l) + ((loop init-line! quote-depth first-qq?) (car l)) + (lloop (cdr l) qq?)] + [else + (advance l init-line! -2) + (out ". " (if (positive? quote-depth) value-color paren-color)) + (set! src-col (+ src-col 3)) + (hash-set! next-col-map src-col dest-col) + ((loop init-line! quote-depth first-qq?) l)])) + (out (case sh + [(#\[ #\?) "]"] + [(#\{) "}"] + [else ")"]) + p-color) + (set! src-col (+ src-col 1)) + #; + (hash-set! next-col-map src-col dest-col)))] + [(box? (syntax-e c)) + (advance c init-line!) + (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) + (out "#&" value-color) + (set! src-col (+ src-col 2)) + (hash-set! next-col-map src-col dest-col) + ((loop init-line! (if qq? quote-depth +inf.0) qq?) (unbox (syntax-e c))))] + [(hash? (syntax-e c)) + (advance c init-line!) + (let ([equal-table? (not (hash-eq? (syntax-e c)))] + [quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) + (out (if equal-table? + "#hash" + "#hasheq") + value-color) + (let ([delta (+ 5 (if equal-table? 2 0))] + [orig-col src-col]) + (set! src-col (+ src-col delta)) + (hash-set! next-col-map src-col dest-col) + ((loop init-line! (if qq? quote-depth +inf.0) qq?) + (syntax-ize (hash-map (syntax-e c) cons) + (+ (syntax-column c) delta))) + (set! src-col (+ orig-col (syntax-span c)))))] + [(graph-reference? (syntax-e c)) + (advance c init-line!) + (out (format "#~a#" (unbox (graph-reference-bx (syntax-e c)))) + (if (positive? quote-depth) + value-color + paren-color)) + (set! src-col (+ src-col (syntax-span c)))] + [(graph-defn? (syntax-e c)) + (advance c init-line!) + (let ([bx (graph-defn-bx (syntax-e c))]) + (out (format "#~a=" (unbox bx)) + (if (positive? quote-depth) + value-color + paren-color)) + (set! src-col (+ src-col 3)) + ((loop init-line! quote-depth qq?) (graph-defn-r (syntax-e c))))] + [else + (advance c init-line!) + (typeset-atom c out color? quote-depth qq?) + (set! src-col (+ src-col (or (syntax-span c) 1))) + #; + (hash-set! next-col-map src-col dest-col)]))) + (out prefix1 #f) + (set! dest-col 0) + (hash-set! next-col-map init-col dest-col) + ((loop (lambda () (set! src-col init-col) (set! dest-col 0)) 0 qq?) c) + (if (list? suffix) + (map (lambda (sfx) + (finish-line!) + (out sfx #f)) + suffix) + (out suffix #f)) + (unless (null? content) + (finish-line!)) + (if multi-line? + (if (= 1 (length docs)) + (car docs) + (make-table block-color (map list (reverse docs)))) + (make-sized-element #f (reverse content) dest-col)))) + + (define (typeset c multi-line? prefix1 prefix suffix color? qq?) + (let* ([c (syntax-ize c 0 #:qq? qq?)] + [s (syntax-e c)]) + (if (or multi-line? + (eq? 'code:blank s) + (pair? s) + (vector? s) + (struct? s) + (box? s) + (null? s) + (hash? s) + (graph-defn? s) + (graph-reference? s) + (struct-proxy? s)) + (gen-typeset c multi-line? prefix1 prefix suffix color? qq?) + (typeset-atom c + (letrec ([mk + (case-lambda + [(elem color) + (mk elem color (or (syntax-span c) 1))] + [(elem color len) + (if (and (string? elem) + (= len (string-length elem))) + (make-element/cache (and color? color) elem) + (make-sized-element (and color? color) elem len))])]) + mk) + color? 0 qq?)))) + + (define (to-element c #:qq? [qq? #f]) + (typeset c #f "" "" "" #t qq?)) + + (define (to-element/no-color c #:qq? [qq? #f]) + (typeset c #f "" "" "" #f qq?)) + + (define (to-paragraph c #:qq? [qq? #f]) + (typeset c #t "" "" "" #t qq?)) + + (define ((to-paragraph/prefix pfx1 pfx sfx) c #:qq? [qq? #f]) + (typeset c #t pfx1 pfx sfx #t qq?)) + + (begin-for-syntax + (define-struct variable-id (sym) + #:omit-define-syntaxes + #:property prop:procedure (lambda (self stx) + (raise-syntax-error + #f + (string-append + "misuse of an identifier (not in `racket', etc.) that is" + " bound as a code-typesetting variable") + stx))) + (define-struct element-id-transformer (proc) + #:omit-define-syntaxes + #:property prop:procedure (lambda (self stx) + (raise-syntax-error + #f + (string-append + "misuse of an identifier (not in `racket', etc.) that is" + " bound as an code-typesetting element transformer") + stx)))) + + (define-syntax (define-code stx) + (syntax-case stx () + [(_ code typeset-code uncode d->s stx-prop) + (syntax/loc stx + (define-syntax (code stx) + (define (wrap-loc v ctx e) + `(,#'d->s ,ctx + ,e + #(code + ,(syntax-line v) + ,(syntax-column v) + ,(syntax-position v) + ,(syntax-span v)))) + (define (stx->loc-s-expr v) + (let ([slv (and (identifier? v) + (syntax-local-value v (lambda () #f)))]) + (cond + [(variable-id? slv) + (wrap-loc v #f `(,#'make-var-id ',(variable-id-sym slv)))] + [(element-id-transformer? slv) + (wrap-loc v #f ((element-id-transformer-proc slv) v))] + [(syntax? v) + (let ([mk (wrap-loc + v + `(quote-syntax ,(datum->syntax v 'defcode)) + (syntax-case v (uncode) + [(uncode e) #'e] + [else (stx->loc-s-expr (syntax-e v))]))]) + (let ([prop (syntax-property v 'paren-shape)]) + (if prop + `(,#'stx-prop ,mk 'paren-shape ,prop) + mk)))] + [(null? v) 'null] + [(list? v) `(list . ,(map stx->loc-s-expr v))] + [(pair? v) `(cons ,(stx->loc-s-expr (car v)) + ,(stx->loc-s-expr (cdr v)))] + [(vector? v) `(vector ,@(map + stx->loc-s-expr + (vector->list v)))] + [(and (struct? v) (prefab-struct-key v)) + `(make-prefab-struct (quote ,(prefab-struct-key v)) + ,@(map + stx->loc-s-expr + (cdr (vector->list (struct->vector v)))))] + [(box? v) `(box ,(stx->loc-s-expr (unbox v)))] + [else `(quote ,v)]))) + (define (cvt s) + (datum->syntax #'here (stx->loc-s-expr s) #f)) + (if (eq? (syntax-local-context) 'expression) + (syntax-case stx () + [(_ expr) #`(typeset-code #,(cvt #'expr))] + [(_ expr (... ...)) + #`(typeset-code #,(cvt #'(code:line expr (... ...))))]) + (quasisyntax/loc stx + (#%expression #,stx)))))] + [(_ code typeset-code uncode d->s) + #'(define-code code typeset-code uncode d->s syntax-property)] + [(_ code typeset-code uncode) + #'(define-code code typeset-code uncode datum->syntax syntax-property)] + [(_ code typeset-code) #'(define-code code typeset-code unsyntax)])) + + + (define syntax-ize-hook (make-parameter (lambda (v col) #f))) + + (define (vector->short-list v extract) + (vector->list v) + #; + (let ([l (vector->list v)]) + (reverse (list-tail + (reverse l) + (- (vector-length v) + (let loop ([i (sub1 (vector-length v))]) + (cond + [(zero? i) 1] + [(eq? (extract (vector-ref v i)) + (extract (vector-ref v (sub1 i)))) + (loop (sub1 i))] + [else (add1 i)]))))))) + + (define (short-list->vector v l) + (list->vector + (let ([n (length l)]) + (if (n . < . (vector-length v)) + (reverse (let loop ([r (reverse l)][i (- (vector-length v) n)]) + (if (zero? i) + r + (loop (cons (car r) r) (sub1 i))))) + l)))) + + (define-struct var-id (sym)) + (define-struct shaped-parens (val shape)) + (define-struct just-context (val ctx)) + (define-struct alternate-display (id string)) + (define-struct literal-syntax (stx)) + (define-struct struct-proxy (name content)) + + (define-struct graph-reference (bx)) + (define-struct graph-defn (r bx)) + + (define (syntax-ize v col [line 1] #:qq? [qq? #f]) + (do-syntax-ize v col line (box #hasheq()) #f (and qq? 0))) + + (define (graph-count ht graph?) + (and graph? + (let ([n (hash-ref (unbox ht) '#%graph-count 0)]) + (set-box! ht (hash-set (unbox ht) '#%graph-count (add1 n))) + n))) + + (define (do-syntax-ize v col line ht graph? qq) + (cond + [((syntax-ize-hook) v col) + => (lambda (r) r)] + [(shaped-parens? v) + (syntax-property (do-syntax-ize (shaped-parens-val v) col line ht #f qq) + 'paren-shape + (shaped-parens-shape v))] + [(just-context? v) + (let ([s (do-syntax-ize (just-context-val v) col line ht #f qq)]) + (datum->syntax (just-context-ctx v) + (syntax-e s) + s + s + (just-context-ctx v)))] + [(alternate-display? v) + (let ([s (do-syntax-ize (alternate-display-id v) col line ht #f qq)]) + (syntax-property s + 'display-string + (alternate-display-string v)))] + [(hash-ref (unbox ht) v #f) + => (lambda (m) + (unless (unbox m) + (set-box! m #t)) + (datum->syntax #f + (make-graph-reference m) + (vector #f line col (+ 1 col) 1)))] + [(and (list? v) + (pair? v) + (let ([s (let ([s (car v)]) + (if (just-context? s) + (just-context-val s) + s))]) + (and + (or (memq s '(quaisquote quote)) + (and (memq s '(unquote unquote-splicing)) + (or (not qq) + (qq . > . 2)))) + s))) + => (lambda (s) + (let ([c (do-syntax-ize (cadr v) (+ col 1) line ht #f qq)]) + (datum->syntax #f + (list (do-syntax-ize (car v) col line ht #f + (and qq + (case s + [(quaisquote) (add1 qq)] + [(unquote unquote-splicing) (sub1 qq)] + [else qq]))) + c) + (vector #f line col (+ 1 col) + (+ 1 (syntax-span c))))))] + [(or (list? v) + (vector? v) + (and (struct? v) + (or (and qq + ;; Watch out for partially transparent subtypes of `element': + (not (element? v))) + (prefab-struct-key v)))) + (let ([orig-ht (unbox ht)] + [graph-box (box (graph-count ht graph?))] + [qq (and qq (max 1 qq))]) + (set-box! ht (hash-set (unbox ht) v graph-box)) + (let* ([graph-sz (if graph? + (+ 2 (string-length (format "~a" (unbox graph-box)))) + 0)] + [vec-sz (cond + [(vector? v) + (+ 1 #;(string-length (format "~a" (vector-length v))))] + [(struct? v) + (if (prefab-struct-key v) + 2 + 0)] + [else 0])] + [r (let ([l (let loop ([col (+ col 1 vec-sz graph-sz)] + [v (cond + [(vector? v) + (vector->short-list v values)] + [(struct? v) + (cons (let ([pf (prefab-struct-key v)]) + (if pf + (prefab-struct-key v) + (object-name v))) + (cdr (vector->list (struct->vector v))))] + [else v])]) + (if (null? v) + null + (let ([i (do-syntax-ize (car v) col line ht #f qq)]) + (cons i + (loop (+ col 1 (syntax-span i)) (cdr v))))))]) + (datum->syntax #f + (cond + [(vector? v) (short-list->vector v l)] + [(struct? v) + (let ([pf (prefab-struct-key v)]) + (if pf + (apply make-prefab-struct (prefab-struct-key v) (cdr l)) + (make-struct-proxy (car l) (cdr l))))] + [else l]) + (vector #f line + (+ graph-sz col) + (+ 1 graph-sz col) + (+ 2 + vec-sz + (if (zero? (length l)) + 0 + (sub1 (length l))) + (apply + (map syntax-span l))))))]) + (unless graph? + (set-box! ht (hash-set (unbox ht) v #f))) + (cond + [graph? (datum->syntax #f + (make-graph-defn r graph-box) + (vector #f (syntax-line r) + (- (syntax-column r) graph-sz) + (- (syntax-position r) graph-sz) + (+ (syntax-span r) graph-sz)))] + [(unbox graph-box) + ;; Go again, this time knowing that there will be a graph: + (set-box! ht orig-ht) + (do-syntax-ize v col line ht #t qq)] + [else r])))] + [(pair? v) + (let ([orig-ht (unbox ht)] + [graph-box (box (graph-count ht graph?))] + [qq (and qq (max 1 qq))]) + (set-box! ht (hash-set (unbox ht) v graph-box)) + (let* ([inc (if graph? + (+ 2 (string-length (format "~a" (unbox graph-box)))) + 0)] + [a (do-syntax-ize (car v) (+ col 1 inc) line ht #f qq)] + [sep (if (and (pair? (cdr v)) + ;; FIXME: what if it turns out to be a graph reference? + (not (hash-ref (unbox ht) (cdr v) #f))) + 0 + 3)] + [b (do-syntax-ize (cdr v) (+ col 1 inc (syntax-span a) sep) line ht #f qq)]) + (let ([r (datum->syntax #f + (cons a b) + (vector #f line (+ col inc) (+ 1 col inc) + (+ 2 sep (syntax-span a) (syntax-span b))))]) + (unless graph? + (set-box! ht (hash-set (unbox ht) v #f))) + (cond + [graph? (datum->syntax #f + (make-graph-defn r graph-box) + (vector #f line col (+ 1 col) + (+ inc (syntax-span r))))] + [(unbox graph-box) + ;; Go again... + (set-box! ht orig-ht) + (do-syntax-ize v col line ht #t qq)] + [else r]))))] + [(box? v) + (let ([a (do-syntax-ize (unbox v) (+ col 2) line ht #f (and qq (max 1 qq)))]) + (datum->syntax #f + (box a) + (vector #f line col (+ 1 col) + (+ 2 (syntax-span a)))))] + [else + (datum->syntax #f v (vector #f line col (+ 1 col) 1))]))) diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss index 15ba5c77b7..67b1f198d6 100644 --- a/collects/scribble/scheme.ss +++ b/collects/scribble/scheme.ss @@ -1,985 +1,3 @@ -(module scheme scheme/base - (require "core.ss" - "basic.ss" - "search.ss" - "private/manual-sprop.ss" - "private/on-demand.ss" - mzlib/class - mzlib/for - syntax/modresolve - syntax/modcode - (for-syntax scheme/base)) - - (provide define-code - to-element - to-element/no-color - to-paragraph - to-paragraph/prefix - syntax-ize - syntax-ize-hook - current-keyword-list - current-variable-list - current-meta-list - - input-color - output-color - input-background-color - no-color - reader-color - result-color - keyword-color - comment-color - paren-color - meta-color - value-color - symbol-color - variable-color - opt-color - error-color - syntax-link-color - value-link-color - module-color - module-link-color - block-color - highlighted-color - - (struct-out var-id) - (struct-out shaped-parens) - (struct-out just-context) - (struct-out alternate-display) - (struct-out literal-syntax) - (for-syntax make-variable-id - variable-id? - make-element-id-transformer - element-id-transformer?)) - - (define (make-scheme-style s #:tt? [tt? #t]) - (make-style s (if tt? - (cons 'tt-chars scheme-properties) - scheme-properties))) - - (define-on-demand output-color (make-scheme-style "ScmOut")) - (define-on-demand input-color (make-scheme-style "ScmIn")) - (define-on-demand input-background-color (make-scheme-style "ScmInBG")) - (define-on-demand no-color (make-scheme-style "ScmPlain")) - (define-on-demand reader-color (make-scheme-style "ScmRdr")) - (define-on-demand result-color (make-scheme-style "ScmRes")) - (define-on-demand keyword-color (make-scheme-style "ScmKw")) - (define-on-demand comment-color (make-scheme-style "ScmCmt")) - (define-on-demand paren-color (make-scheme-style "ScmPn")) - (define-on-demand meta-color (make-scheme-style "ScmMeta")) - (define-on-demand value-color (make-scheme-style "ScmVal")) - (define-on-demand symbol-color (make-scheme-style "ScmSym")) - (define-on-demand variable-color (make-scheme-style "ScmVar")) - (define-on-demand opt-color (make-scheme-style "ScmOpt")) - (define-on-demand error-color (make-scheme-style "ScmErr" #:tt? #f)) - (define-on-demand syntax-link-color (make-scheme-style "ScmStxLink")) - (define-on-demand value-link-color (make-scheme-style "ScmValLink")) - (define-on-demand module-color (make-scheme-style "ScmMod")) - (define-on-demand module-link-color (make-scheme-style "ScmModLink")) - (define-on-demand block-color (make-scheme-style "ScmBlk")) - (define-on-demand highlighted-color (make-scheme-style "highlighted" #:tt? #f)) - - (define current-keyword-list - (make-parameter null)) - (define current-variable-list - (make-parameter null)) - (define current-meta-list - (make-parameter null)) - - (define defined-names (make-hasheq)) - - (define-struct (sized-element element) (length)) - - (define-struct (spaces element) (cnt)) - - (define (literalize-spaces i) - (let ([m (regexp-match-positions #rx" +" i)]) - (if m - (let ([cnt (- (cdar m) (caar m))]) - (make-spaces #f - (list - (literalize-spaces (substring i 0 (caar m))) - (hspace cnt) - (literalize-spaces (substring i (cdar m)))) - cnt)) - i))) - - - (define line-breakable-space (make-element 'tt " ")) - - ;; These caches intentionally record a key with the value. - ;; That way, when the value is no longer used, the key - ;; goes away, and the entry is gone. - - (define id-element-cache (make-weak-hash)) - (define element-cache (make-weak-hash)) - - (define-struct (cached-delayed-element delayed-element) (cache-key)) - (define-struct (cached-element element) (cache-key)) - - (define (make-id-element c s) - (let* ([key (and id-element-cache - (let ([b (identifier-label-binding c)]) - (vector (syntax-e c) - (module-path-index->taglet (caddr b)) - (cadddr b) - (list-ref b 5))))]) - (or (and key - (let ([b (hash-ref id-element-cache key #f)]) - (and b - (weak-box-value b)))) - (let ([e (make-cached-delayed-element - (lambda (renderer sec ri) - (let* ([tag (find-scheme-tag sec ri c #f)]) - (if tag - (list - (case (car tag) - [(form) - (make-link-element syntax-link-color (list s) tag)] - [else - (make-link-element value-link-color (list s) tag)])) - (list - (make-element "badlink" - (make-element value-link-color s)))))) - (lambda () s) - (lambda () s) - key)]) - (when key - (hash-set! id-element-cache key (make-weak-box e))) - e)))) - - (define (make-element/cache style content) - (if (and element-cache - (string? content)) - (let ([key (vector style content)]) - (let ([b (hash-ref element-cache key #f)]) - (or (and b (weak-box-value b)) - (let ([e (make-cached-element style content key)]) - (hash-set! element-cache key (make-weak-box e)) - e)))) - (make-element style content))) - - (define (to-quoted qs qq? quote-depth out color? inc!) - (if (and qq? (zero? quote-depth)) - (begin - (out qs (and color? value-color)) - (inc!) - (add1 quote-depth)) - quote-depth)) - - (define (to-unquoted qq? quote-depth out color? inc!) - (if (or (not qq?) (zero? quote-depth)) - quote-depth - (begin - (out "," (and color? meta-color)) - (inc!) - (to-unquoted qq? (sub1 quote-depth) out color? inc!)))) - - (define (typeset-atom c out color? quote-depth qq?) - (if (and (var-id? (syntax-e c)) - (zero? quote-depth)) - (out (format "~s" (let ([v (var-id-sym (syntax-e c))]) - (if (syntax? v) - (syntax-e v) - v))) - variable-color) - (let*-values ([(is-var?) (and (identifier? c) - (memq (syntax-e c) (current-variable-list)))] - [(s it? sub?) - (let ([sc (syntax-e c)]) - (let ([s (or (syntax-property c 'display-string) - (format "~s" (if (literal-syntax? sc) - (literal-syntax-stx sc) - (if (var-id? sc) - (var-id-sym sc) - sc))))]) - (if (and (symbol? sc) - ((string-length s) . > . 1) - (char=? (string-ref s 0) #\_) - (not (or (identifier-label-binding c) - is-var?))) - (values (substring s 1) #t #f) - (values s #f #f))))]) - (let ([quote-depth (if (and qq? (identifier? c)) - (let ([quote-depth - (if (and (quote-depth . < . 2) - (memq (syntax-e c) '(unquote unquote-splicing))) - (to-unquoted qq? quote-depth out color? void) - quote-depth)]) - (to-quoted "'" qq? quote-depth out color? void)) - quote-depth)]) - (if (or (element? (syntax-e c)) - (delayed-element? (syntax-e c)) - (part-relative-element? (syntax-e c))) - (out (syntax-e c) #f) - (out (if (and (identifier? c) - color? - (quote-depth . <= . 0) - (not (or it? is-var?))) - (if (pair? (identifier-label-binding c)) - (make-id-element c s) - s) - (literalize-spaces s)) - (cond - [(positive? quote-depth) value-color] - [(let ([v (syntax-e c)]) - (or (number? v) - (string? v) - (bytes? v) - (char? v) - (regexp? v) - (byte-regexp? v) - (boolean? v))) - value-color] - [(identifier? c) - (cond - [is-var? - variable-color] - [(and (identifier? c) - (memq (syntax-e c) (current-keyword-list))) - keyword-color] - [(and (identifier? c) - (memq (syntax-e c) (current-meta-list))) - meta-color] - [it? variable-color] - [else symbol-color])] - [else paren-color]) - (string-length s))))))) - - (define omitable (make-style #f '(omitable))) - - (define (gen-typeset c multi-line? prefix1 prefix suffix color? qq?) - (let* ([c (syntax-ize c 0 #:qq? qq?)] - [content null] - [docs null] - [first (syntax-case c (code:line) - [(code:line e . rest) #'e] - [else c])] - [init-col (or (syntax-column first) 0)] - [src-col init-col] - [inc-src-col (lambda () (set! src-col (add1 src-col)))] - [dest-col 0] - [highlight? #f] - [col-map (make-hash)] - [next-col-map (make-hash)] - [line (or (syntax-line first) 0)]) - (define (finish-line!) - (when multi-line? - (set! docs (cons (make-paragraph omitable (reverse content)) - docs)) - (set! content null))) - (define out - (case-lambda - [(v cls) - (out v cls (let sz-loop ([v v]) - (cond - [(string? v) (string-length v)] - [(list? v) (for/fold ([s 0]) ([v (in-list v)]) (+ s (sz-loop v)))] - [(sized-element? v) (sized-element-length v)] - [(element? v) - (sz-loop (element-content v))] - [(delayed-element? v) - (content-width v)] - [(part-relative-element? v) - (content-width v)] - [(spaces? v) - (+ (sz-loop (car (element-content v))) - (spaces-cnt v) - (sz-loop (caddr (element-content v))))] - [else 1])))] - [(v cls len) - (unless (equal? v "") - (cond - [(spaces? v) - (out (car (element-content v)) cls 0) - (out (cadr (element-content v)) #f 0) - (out (caddr (element-content v)) cls len)] - [(equal? v "\n") - (if multi-line? - (begin - (finish-line!) - (out prefix cls)) - (out " " cls))] - [else - (set! content (cons ((if highlight? - (lambda (c) - (make-element highlighted-color c)) - values) - (if (and color? cls) - (make-element/cache cls v) - v)) - content)) - (set! dest-col (+ dest-col len))]))])) - (define advance - (case-lambda - [(c init-line! delta) - (let ([c (+ delta (or (syntax-column c) 0))] - [l (syntax-line c)]) - (let ([new-line? (and l (l . > . line))]) - (when new-line? - (for ([i (in-range (- l line))]) - (out "\n" no-color)) - (set! line l) - (set! col-map next-col-map) - (set! next-col-map (make-hash)) - (init-line!)) - (let ([d-col (let ([def-val (+ dest-col (- c src-col))]) - (if new-line? - (hash-ref col-map c def-val) - def-val))]) - (let ([amt (- d-col dest-col)]) - (when (positive? amt) - (let ([old-dest-col dest-col]) - (out (if (and (= 1 amt) (not multi-line?)) - line-breakable-space ; allows a line break to replace the space - (hspace amt)) - #f) - (set! dest-col (+ old-dest-col amt)))))) - (set! src-col c) - (hash-set! next-col-map src-col dest-col)))] - [(c init-line!) (advance c init-line! 0)])) - (define (convert-infix c quote-depth qq?) - (let ([l (syntax->list c)]) - (and l - ((length l) . >= . 3) - ((or (syntax-position (car l)) -inf.0) - . > . - (or (syntax-position (cadr l)) +inf.0)) - (let ([a (car l)]) - (let loop ([l (cdr l)] - [prev null]) - (cond - [(null? l) #f] ; couldn't unwind - [else (let ([p2 (syntax-position (car l))]) - (if (and p2 - (p2 . > . (syntax-position a))) - (datum->syntax c - (append - (reverse prev) - (list - (datum->syntax - a - (let ([val? (positive? quote-depth)]) - (make-sized-element - (if val? value-color #f) - (list - (make-element/cache (if val? value-color paren-color) '". ") - (typeset a #f "" "" "" (not val?) qq?) - (make-element/cache (if val? value-color paren-color) '" .")) - (+ (syntax-span a) 4))) - (list (syntax-source a) - (syntax-line a) - (- (syntax-column a) 2) - (- (syntax-position a) 2) - (+ (syntax-span a) 4)) - a)) - l) - c - c) - (loop (cdr l) - (cons (car l) prev))))])))))) - (define (no-fancy-chars s) - (cond - [(eq? s 'rsquo) "'"] - [else s])) - (define (loop init-line! quote-depth qq?) - (lambda (c) - (cond - [(eq? 'code:blank (syntax-e c)) - (advance c init-line!)] - [(and (pair? (syntax-e c)) - (eq? (syntax-e (car (syntax-e c))) 'code:comment)) - (let ([l (syntax->list c)]) - (unless (and l (= 2 (length l))) - (raise-syntax-error - #f - "does not have a single sub-form" - c))) - (advance c init-line!) - (out ";" comment-color) - (out 'nbsp comment-color) - (let ([v (syntax->datum (cadr (syntax->list c)))]) - (if (paragraph? v) - (map (lambda (v) - (let ([v (no-fancy-chars v)]) - (if (or (string? v) (symbol? v)) - (out v comment-color) - (out v #f)))) - (paragraph-content v)) - (out (no-fancy-chars v) comment-color)))] - [(and (pair? (syntax-e c)) - (eq? (syntax-e (car (syntax-e c))) 'code:contract)) - (advance c init-line!) - (out "; " comment-color) - (let* ([l (cdr (syntax->list c))] - [s-col (or (syntax-column (car l)) src-col)]) - (set! src-col s-col) - (for-each (loop (lambda () - (set! src-col s-col) - (set! dest-col 0) - (out "; " comment-color)) - 0 - qq?) - l))] - [(and (pair? (syntax-e c)) - (eq? (syntax-e (car (syntax-e c))) 'code:line)) - (let ([l (cdr (syntax->list c))]) - (for-each (loop init-line! quote-depth qq?) - l))] - [(and (pair? (syntax-e c)) - (eq? (syntax-e (car (syntax-e c))) 'code:hilite)) - (let ([l (syntax->list c)] - [h? highlight?]) - (unless (and l (= 2 (length l))) - (error "bad code:redex: ~e" (syntax->datum c))) - (advance c init-line!) - (set! src-col (syntax-column (cadr l))) - (hash-set! next-col-map src-col dest-col) - (set! highlight? #t) - ((loop init-line! quote-depth qq?) (cadr l)) - (set! highlight? h?) - (set! src-col (add1 src-col)))] - [(and (pair? (syntax-e c)) - (eq? (syntax-e (car (syntax-e c))) 'code:quote)) - (advance c init-line!) - (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) - (out "(" (if (positive? quote-depth) value-color paren-color)) - (set! src-col (+ src-col 1)) - (hash-set! next-col-map src-col dest-col) - ((loop init-line! quote-depth qq?) - (datum->syntax #'here 'quote (car (syntax-e c)))) - (for-each (loop init-line! (add1 quote-depth) qq?) - (cdr (syntax->list c))) - (out ")" (if (positive? quote-depth) value-color paren-color)) - (set! src-col (+ src-col 1)) - #; - (hash-set! next-col-map src-col dest-col))] - [(and (pair? (syntax-e c)) - (memq (syntax-e (car (syntax-e c))) - '(quote quasiquote unquote unquote-splicing - quasisyntax syntax unsyntax unsyntax-splicing)) - (let ([v (syntax->list c)]) - (and v (= 2 (length v)))) - (or (not qq?) - (quote-depth . > . 1) - (not (memq (syntax-e (car (syntax-e c))) - '(unquote unquote-splicing))))) - (advance c init-line!) - (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) - (let-values ([(str quote-delta) - (case (syntax-e (car (syntax-e c))) - [(quote) (values "'" +inf.0)] - [(unquote) (values "," -1)] - [(unquote-splicing) (values ",@" -1)] - [(quasiquote) (values "`" +1)] - [(syntax) (values "#'" 0)] - [(quasisyntax) (values "#`" 0)] - [(unsyntax) (values "#," 0)] - [(unsyntax-splicing) (values "#,@" 0)])]) - (out str (if (positive? (+ quote-depth quote-delta)) - value-color - reader-color)) - (let ([i (cadr (syntax->list c))]) - (set! src-col (or (syntax-column i) src-col)) - (hash-set! next-col-map src-col dest-col) - ((loop init-line! (+ quote-depth quote-delta) qq?) i))))] - [(and (pair? (syntax-e c)) - (convert-infix c quote-depth qq?)) - => (lambda (converted) - ((loop init-line! quote-depth qq?) converted))] - [(or (pair? (syntax-e c)) - (null? (syntax-e c)) - (vector? (syntax-e c)) - (and (struct? (syntax-e c)) - (prefab-struct-key (syntax-e c))) - (struct-proxy? (syntax-e c))) - (let* ([sh (or (syntax-property c 'paren-shape) - #\()] - [quote-depth (if (and (not qq?) - (zero? quote-depth) - (or (vector? (syntax-e c)) - (struct? (syntax-e c)))) - +inf.0 - quote-depth)] - [p-color (if (positive? quote-depth) - value-color - (if (eq? sh #\?) - opt-color - paren-color))]) - (advance c init-line!) - (let ([quote-depth (if (struct-proxy? (syntax-e c)) - (to-unquoted qq? quote-depth out color? inc-src-col) - (to-quoted "`" qq? quote-depth out color? inc-src-col))]) - (when (vector? (syntax-e c)) - (let ([vec (syntax-e c)]) - (out "#" #;(format "#~a" (vector-length vec)) p-color) - (if (zero? (vector-length vec)) - (set! src-col (+ src-col (- (syntax-span c) 2))) - (set! src-col (+ src-col (- (syntax-column (vector-ref vec 0)) - (syntax-column c) - 1)))))) - (when (struct? (syntax-e c)) - (out "#s" p-color) - (set! src-col (+ src-col 2))) - (out (case sh - [(#\[ #\?) "["] - [(#\{) "{"] - [else "("]) - p-color) - (set! src-col (+ src-col 1)) - (hash-set! next-col-map src-col dest-col) - (let lloop ([l (cond - [(vector? (syntax-e c)) - (vector->short-list (syntax-e c) syntax-e)] - [(struct? (syntax-e c)) - (let ([l (vector->list (struct->vector (syntax-e c)))]) - ;; Need to build key datum, syntax-ize it internally, and - ;; set the overall width to fit right: - (cons (let ([key (syntax-ize (prefab-struct-key (syntax-e c)) - (+ 3 (or (syntax-column c) 0)) - (or (syntax-line c) 1))] - [end (if (pair? (cdr l)) - (and (equal? (syntax-line c) (syntax-line (cadr l))) - (syntax-column (cadr l))) - (and (syntax-column c) - (+ (syntax-column c) (syntax-span c))))]) - (if end - (datum->syntax #f - (syntax-e key) - (vector #f (syntax-line key) - (syntax-column key) - (syntax-position key) - (- end 1 (syntax-column key)))) - end)) - (cdr l)))] - [(struct-proxy? (syntax-e c)) - (cons - (struct-proxy-name (syntax-e c)) - (struct-proxy-content (syntax-e c)))] - [else c])] - [first-qq? (and qq? (not (struct-proxy? (syntax-e c))))]) - (cond - [(and (syntax? l) - (pair? (syntax-e l)) - (not (and (memq (syntax-e (car (syntax-e l))) - '(quote unquote syntax unsyntax quasiquote quasiunsyntax)) - (let ([v (syntax->list l)]) - (and v (= 2 (length v)))) - (or (not qq?) - (quote-depth . > . 1) - (not (memq (syntax-e (car (syntax-e l))) - '(unquote unquote-splicing))))))) - (lloop (syntax-e l) first-qq?)] - [(or (null? l) - (and (syntax? l) - (null? (syntax-e l)))) - (void)] - [(pair? l) - ((loop init-line! quote-depth first-qq?) (car l)) - (lloop (cdr l) qq?)] - [else - (advance l init-line! -2) - (out ". " (if (positive? quote-depth) value-color paren-color)) - (set! src-col (+ src-col 3)) - (hash-set! next-col-map src-col dest-col) - ((loop init-line! quote-depth first-qq?) l)])) - (out (case sh - [(#\[ #\?) "]"] - [(#\{) "}"] - [else ")"]) - p-color) - (set! src-col (+ src-col 1)) - #; - (hash-set! next-col-map src-col dest-col)))] - [(box? (syntax-e c)) - (advance c init-line!) - (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) - (out "#&" value-color) - (set! src-col (+ src-col 2)) - (hash-set! next-col-map src-col dest-col) - ((loop init-line! (if qq? quote-depth +inf.0) qq?) (unbox (syntax-e c))))] - [(hash? (syntax-e c)) - (advance c init-line!) - (let ([equal-table? (not (hash-eq? (syntax-e c)))] - [quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) - (out (if equal-table? - "#hash" - "#hasheq") - value-color) - (let ([delta (+ 5 (if equal-table? 2 0))] - [orig-col src-col]) - (set! src-col (+ src-col delta)) - (hash-set! next-col-map src-col dest-col) - ((loop init-line! (if qq? quote-depth +inf.0) qq?) - (syntax-ize (hash-map (syntax-e c) cons) - (+ (syntax-column c) delta))) - (set! src-col (+ orig-col (syntax-span c)))))] - [(graph-reference? (syntax-e c)) - (advance c init-line!) - (out (format "#~a#" (unbox (graph-reference-bx (syntax-e c)))) - (if (positive? quote-depth) - value-color - paren-color)) - (set! src-col (+ src-col (syntax-span c)))] - [(graph-defn? (syntax-e c)) - (advance c init-line!) - (let ([bx (graph-defn-bx (syntax-e c))]) - (out (format "#~a=" (unbox bx)) - (if (positive? quote-depth) - value-color - paren-color)) - (set! src-col (+ src-col 3)) - ((loop init-line! quote-depth qq?) (graph-defn-r (syntax-e c))))] - [else - (advance c init-line!) - (typeset-atom c out color? quote-depth qq?) - (set! src-col (+ src-col (or (syntax-span c) 1))) - #; - (hash-set! next-col-map src-col dest-col)]))) - (out prefix1 #f) - (set! dest-col 0) - (hash-set! next-col-map init-col dest-col) - ((loop (lambda () (set! src-col init-col) (set! dest-col 0)) 0 qq?) c) - (if (list? suffix) - (map (lambda (sfx) - (finish-line!) - (out sfx #f)) - suffix) - (out suffix #f)) - (unless (null? content) - (finish-line!)) - (if multi-line? - (if (= 1 (length docs)) - (car docs) - (make-table block-color (map list (reverse docs)))) - (make-sized-element #f (reverse content) dest-col)))) - - (define (typeset c multi-line? prefix1 prefix suffix color? qq?) - (let* ([c (syntax-ize c 0 #:qq? qq?)] - [s (syntax-e c)]) - (if (or multi-line? - (eq? 'code:blank s) - (pair? s) - (vector? s) - (struct? s) - (box? s) - (null? s) - (hash? s) - (graph-defn? s) - (graph-reference? s) - (struct-proxy? s)) - (gen-typeset c multi-line? prefix1 prefix suffix color? qq?) - (typeset-atom c - (letrec ([mk - (case-lambda - [(elem color) - (mk elem color (or (syntax-span c) 1))] - [(elem color len) - (if (and (string? elem) - (= len (string-length elem))) - (make-element/cache (and color? color) elem) - (make-sized-element (and color? color) elem len))])]) - mk) - color? 0 qq?)))) - - (define (to-element c #:qq? [qq? #f]) - (typeset c #f "" "" "" #t qq?)) - - (define (to-element/no-color c #:qq? [qq? #f]) - (typeset c #f "" "" "" #f qq?)) - - (define (to-paragraph c #:qq? [qq? #f]) - (typeset c #t "" "" "" #t qq?)) - - (define ((to-paragraph/prefix pfx1 pfx sfx) c #:qq? [qq? #f]) - (typeset c #t pfx1 pfx sfx #t qq?)) - - (begin-for-syntax - (define-struct variable-id (sym) - #:omit-define-syntaxes - #:property prop:procedure (lambda (self stx) - (raise-syntax-error - #f - (string-append - "misuse of an identifier (not in `scheme', etc.) that is" - " bound as a code-typesetting variable") - stx))) - (define-struct element-id-transformer (proc) - #:omit-define-syntaxes - #:property prop:procedure (lambda (self stx) - (raise-syntax-error - #f - (string-append - "misuse of an identifier (not in `scheme', etc.) that is" - " bound as an code-typesetting element transformer") - stx)))) - - (define-syntax (define-code stx) - (syntax-case stx () - [(_ code typeset-code uncode d->s stx-prop) - (syntax/loc stx - (define-syntax (code stx) - (define (wrap-loc v ctx e) - `(,#'d->s ,ctx - ,e - #(code - ,(syntax-line v) - ,(syntax-column v) - ,(syntax-position v) - ,(syntax-span v)))) - (define (stx->loc-s-expr v) - (let ([slv (and (identifier? v) - (syntax-local-value v (lambda () #f)))]) - (cond - [(variable-id? slv) - (wrap-loc v #f `(,#'make-var-id ',(variable-id-sym slv)))] - [(element-id-transformer? slv) - (wrap-loc v #f ((element-id-transformer-proc slv) v))] - [(syntax? v) - (let ([mk (wrap-loc - v - `(quote-syntax ,(datum->syntax v 'defcode)) - (syntax-case v (uncode) - [(uncode e) #'e] - [else (stx->loc-s-expr (syntax-e v))]))]) - (let ([prop (syntax-property v 'paren-shape)]) - (if prop - `(,#'stx-prop ,mk 'paren-shape ,prop) - mk)))] - [(null? v) 'null] - [(list? v) `(list . ,(map stx->loc-s-expr v))] - [(pair? v) `(cons ,(stx->loc-s-expr (car v)) - ,(stx->loc-s-expr (cdr v)))] - [(vector? v) `(vector ,@(map - stx->loc-s-expr - (vector->list v)))] - [(and (struct? v) (prefab-struct-key v)) - `(make-prefab-struct (quote ,(prefab-struct-key v)) - ,@(map - stx->loc-s-expr - (cdr (vector->list (struct->vector v)))))] - [(box? v) `(box ,(stx->loc-s-expr (unbox v)))] - [else `(quote ,v)]))) - (define (cvt s) - (datum->syntax #'here (stx->loc-s-expr s) #f)) - (if (eq? (syntax-local-context) 'expression) - (syntax-case stx () - [(_ expr) #`(typeset-code #,(cvt #'expr))] - [(_ expr (... ...)) - #`(typeset-code #,(cvt #'(code:line expr (... ...))))]) - (quasisyntax/loc stx - (#%expression #,stx)))))] - [(_ code typeset-code uncode d->s) - #'(define-code code typeset-code uncode d->s syntax-property)] - [(_ code typeset-code uncode) - #'(define-code code typeset-code uncode datum->syntax syntax-property)] - [(_ code typeset-code) #'(define-code code typeset-code unsyntax)])) - - - (define syntax-ize-hook (make-parameter (lambda (v col) #f))) - - (define (vector->short-list v extract) - (vector->list v) - #; - (let ([l (vector->list v)]) - (reverse (list-tail - (reverse l) - (- (vector-length v) - (let loop ([i (sub1 (vector-length v))]) - (cond - [(zero? i) 1] - [(eq? (extract (vector-ref v i)) - (extract (vector-ref v (sub1 i)))) - (loop (sub1 i))] - [else (add1 i)]))))))) - - (define (short-list->vector v l) - (list->vector - (let ([n (length l)]) - (if (n . < . (vector-length v)) - (reverse (let loop ([r (reverse l)][i (- (vector-length v) n)]) - (if (zero? i) - r - (loop (cons (car r) r) (sub1 i))))) - l)))) - - (define-struct var-id (sym)) - (define-struct shaped-parens (val shape)) - (define-struct just-context (val ctx)) - (define-struct alternate-display (id string)) - (define-struct literal-syntax (stx)) - (define-struct struct-proxy (name content)) - - (define-struct graph-reference (bx)) - (define-struct graph-defn (r bx)) - - (define (syntax-ize v col [line 1] #:qq? [qq? #f]) - (do-syntax-ize v col line (box #hasheq()) #f (and qq? 0))) - - (define (graph-count ht graph?) - (and graph? - (let ([n (hash-ref (unbox ht) '#%graph-count 0)]) - (set-box! ht (hash-set (unbox ht) '#%graph-count (add1 n))) - n))) - - (define (do-syntax-ize v col line ht graph? qq) - (cond - [((syntax-ize-hook) v col) - => (lambda (r) r)] - [(shaped-parens? v) - (syntax-property (do-syntax-ize (shaped-parens-val v) col line ht #f qq) - 'paren-shape - (shaped-parens-shape v))] - [(just-context? v) - (let ([s (do-syntax-ize (just-context-val v) col line ht #f qq)]) - (datum->syntax (just-context-ctx v) - (syntax-e s) - s - s - (just-context-ctx v)))] - [(alternate-display? v) - (let ([s (do-syntax-ize (alternate-display-id v) col line ht #f qq)]) - (syntax-property s - 'display-string - (alternate-display-string v)))] - [(hash-ref (unbox ht) v #f) - => (lambda (m) - (unless (unbox m) - (set-box! m #t)) - (datum->syntax #f - (make-graph-reference m) - (vector #f line col (+ 1 col) 1)))] - [(and (list? v) - (pair? v) - (let ([s (let ([s (car v)]) - (if (just-context? s) - (just-context-val s) - s))]) - (and - (or (memq s '(quaisquote quote)) - (and (memq s '(unquote unquote-splicing)) - (or (not qq) - (qq . > . 2)))) - s))) - => (lambda (s) - (let ([c (do-syntax-ize (cadr v) (+ col 1) line ht #f qq)]) - (datum->syntax #f - (list (do-syntax-ize (car v) col line ht #f - (and qq - (case s - [(quaisquote) (add1 qq)] - [(unquote unquote-splicing) (sub1 qq)] - [else qq]))) - c) - (vector #f line col (+ 1 col) - (+ 1 (syntax-span c))))))] - [(or (list? v) - (vector? v) - (and (struct? v) - (or (and qq - ;; Watch out for partially transparent subtypes of `element': - (not (element? v))) - (prefab-struct-key v)))) - (let ([orig-ht (unbox ht)] - [graph-box (box (graph-count ht graph?))] - [qq (and qq (max 1 qq))]) - (set-box! ht (hash-set (unbox ht) v graph-box)) - (let* ([graph-sz (if graph? - (+ 2 (string-length (format "~a" (unbox graph-box)))) - 0)] - [vec-sz (cond - [(vector? v) - (+ 1 #;(string-length (format "~a" (vector-length v))))] - [(struct? v) - (if (prefab-struct-key v) - 2 - 0)] - [else 0])] - [r (let ([l (let loop ([col (+ col 1 vec-sz graph-sz)] - [v (cond - [(vector? v) - (vector->short-list v values)] - [(struct? v) - (cons (let ([pf (prefab-struct-key v)]) - (if pf - (prefab-struct-key v) - (object-name v))) - (cdr (vector->list (struct->vector v))))] - [else v])]) - (if (null? v) - null - (let ([i (do-syntax-ize (car v) col line ht #f qq)]) - (cons i - (loop (+ col 1 (syntax-span i)) (cdr v))))))]) - (datum->syntax #f - (cond - [(vector? v) (short-list->vector v l)] - [(struct? v) - (let ([pf (prefab-struct-key v)]) - (if pf - (apply make-prefab-struct (prefab-struct-key v) (cdr l)) - (make-struct-proxy (car l) (cdr l))))] - [else l]) - (vector #f line - (+ graph-sz col) - (+ 1 graph-sz col) - (+ 2 - vec-sz - (if (zero? (length l)) - 0 - (sub1 (length l))) - (apply + (map syntax-span l))))))]) - (unless graph? - (set-box! ht (hash-set (unbox ht) v #f))) - (cond - [graph? (datum->syntax #f - (make-graph-defn r graph-box) - (vector #f (syntax-line r) - (- (syntax-column r) graph-sz) - (- (syntax-position r) graph-sz) - (+ (syntax-span r) graph-sz)))] - [(unbox graph-box) - ;; Go again, this time knowing that there will be a graph: - (set-box! ht orig-ht) - (do-syntax-ize v col line ht #t qq)] - [else r])))] - [(pair? v) - (let ([orig-ht (unbox ht)] - [graph-box (box (graph-count ht graph?))] - [qq (and qq (max 1 qq))]) - (set-box! ht (hash-set (unbox ht) v graph-box)) - (let* ([inc (if graph? - (+ 2 (string-length (format "~a" (unbox graph-box)))) - 0)] - [a (do-syntax-ize (car v) (+ col 1 inc) line ht #f qq)] - [sep (if (and (pair? (cdr v)) - ;; FIXME: what if it turns out to be a graph reference? - (not (hash-ref (unbox ht) (cdr v) #f))) - 0 - 3)] - [b (do-syntax-ize (cdr v) (+ col 1 inc (syntax-span a) sep) line ht #f qq)]) - (let ([r (datum->syntax #f - (cons a b) - (vector #f line (+ col inc) (+ 1 col inc) - (+ 2 sep (syntax-span a) (syntax-span b))))]) - (unless graph? - (set-box! ht (hash-set (unbox ht) v #f))) - (cond - [graph? (datum->syntax #f - (make-graph-defn r graph-box) - (vector #f line col (+ 1 col) - (+ inc (syntax-span r))))] - [(unbox graph-box) - ;; Go again... - (set-box! ht orig-ht) - (do-syntax-ize v col line ht #t qq)] - [else r]))))] - [(box? v) - (let ([a (do-syntax-ize (unbox v) (+ col 2) line ht #f (and qq (max 1 qq)))]) - (datum->syntax #f - (box a) - (vector #f line col (+ 1 col) - (+ 2 (syntax-span a)))))] - [else - (datum->syntax #f v (vector #f line col (+ 1 col) 1))]))) +#lang racket/base +(require "racket.ss") +(provide (all-from-out "racket.ss")) diff --git a/collects/scribblings/main/getting-started.scrbl b/collects/scribblings/main/getting-started.scrbl index ea370a7189..3faf230554 100644 --- a/collects/scribblings/main/getting-started.scrbl +++ b/collects/scribblings/main/getting-started.scrbl @@ -8,11 +8,12 @@ through a textbook: @itemize[ - @item{@italic{@link["http:///www.htdp.org/"]{How to - Design Programs}} is the best place to start.} + @item{@italic{@link["http:///www.htdp.org/"]{How to Design Programs}} + is the best place to start. Whenever the book says ``Scheme,'' + you can read it as ``Racket.''} @item{@other-manual['(lib "web-server/scribblings/tutorial/continue.scrbl")] - introduces you to the Module language and building web applications.} + introduces you to modules and building web applications.} @item{@other-manual['(lib "scribblings/guide/guide.scrbl")] describes the rest of the Racket language, which is much bigger than diff --git a/collects/scribblings/reference/eval-model.scrbl b/collects/scribblings/reference/eval-model.scrbl index b0692ded20..d4c706fc3d 100644 --- a/collects/scribblings/reference/eval-model.scrbl +++ b/collects/scribblings/reference/eval-model.scrbl @@ -1,6 +1,6 @@ #lang scribble/doc @(require scribble/struct - scribble/scheme + scribble/racket (for-syntax racket/base) "mz.ss" "prog-steps.ss") @@ -11,13 +11,13 @@ @(define *redex (lambda (c) (make-element highlighted-color (list c)))) @(define-syntax redex - (syntax-rules () [(_ a) (*redex (scheme a))])) + (syntax-rules () [(_ a) (*redex (racket a))])) @(define hole (make-element #f (list "[]"))) @(define (*sub c e) (make-element #f (list c "[" e "]"))) @(define-syntax sub - (syntax-rules () [(_ a b) (*sub (scheme a) (scheme b))])) + (syntax-rules () [(_ a b) (*sub (racket a) (racket b))])) @(define (frame n) (make-element variable-color (list "C" (make-element 'subscript (list (format "~a" n)))))) @@ -29,21 +29,21 @@ to switch to the usual langle/rangle that is used in syntax definitions. @(define comma (make-element 'tt (list ", "))) @(define (*state c e) (make-element #f (list langle c comma e rangle))) @(define-syntax state - (syntax-rules () [(_ a b) (*state (scheme a) (scheme b))])) + (syntax-rules () [(_ a b) (*state (racket a) (racket b))])) ;} @;------------------------------------------------------------------------ @title[#:tag "eval-model"]{Evaluation Model} -Scheme evaluation can be viewed as the simplification of expressions +Racket evaluation can be viewed as the simplification of expressions to obtain values. For example, just as an elementary-school student simplifies @verbatim{ 1 + 1 = 2} -Scheme evaluation simplifies +Racket evaluation simplifies -@schemeblock[ +@racketblock[ (+ 1 1) @#,reduces 2 ] @@ -51,14 +51,14 @@ The arrow @reduces above replaces the more traditional @tt{=} to emphasize that evaluation proceeds in a particular direction towards simpler expressions. In particular, a @deftech{value} is an expression that evaluation simplifies no further, such as the number -@scheme[2]. +@racket[2]. @;------------------------------------------------------------------------ @section[#:tag "cont-model"]{Sub-expression Evaluation and Continuations} Some simplifications require more than one step. For example: -@schemeblock[ +@racketblock[ (- 4 #,(redex (+ 1 1))) #,reduces #,(redex (- 4 2)) #,reduces 2 ] @@ -66,15 +66,15 @@ An expression that is not a @tech{value} can always be partitioned into two parts: a @deftech{redex}, which is the part that changed in a single-step simplification (highlighted), and the @deftech{continuation}, which is the surrounding expression -context. In @scheme[(- 4 (+ 1 1))], the redex is @scheme[(+ 1 1)], and -the continuation is @scheme[(- 4 @#,hole)], where @hole takes the +context. In @racket[(- 4 (+ 1 1))], the redex is @racket[(+ 1 1)], and +the continuation is @racket[(- 4 @#,hole)], where @hole takes the place of the redex. That is, the continuation says how to ``continue'' after the @tech{redex} is reduced to a @tech{value}. Before some things can be evaluated, some sub-expressions must be -evaluated; for example, in the application @scheme[(- 4 (+ 1 1))], the -application of @scheme[-] cannot be reduced until the sub-expression -@scheme[(+ 1 1)] is reduced. +evaluated; for example, in the application @racket[(- 4 (+ 1 1))], the +application of @racket[-] cannot be reduced until the sub-expression +@racket[(+ 1 1)] is reduced. Thus, the specification of each syntactic form specifies how (some of) its sub-expressions are evaluated, and then how the results are @@ -86,65 +86,65 @@ evaluation steps during which an expression contains the @tech{redex}. @;------------------------------------------------------------------------ @section{Tail Position} -An expression @scheme[_expr1] is in @deftech{tail position} with -respect to an enclosing expression @scheme[_expr2] if, whenever -@scheme[_expr1] becomes a redex, its @tech{continuation} is the same -as was the enclosing @scheme[_expr2]'s @tech{continuation}. +An expression @racket[_expr1] is in @deftech{tail position} with +respect to an enclosing expression @racket[_expr2] if, whenever +@racket[_expr1] becomes a redex, its @tech{continuation} is the same +as was the enclosing @racket[_expr2]'s @tech{continuation}. -For example, the @scheme[(+ 1 1)] expression is @italic{not} in @tech{tail -position} with respect to @scheme[(- 4 (+ 1 1))]. To illustrate, we use +For example, the @racket[(+ 1 1)] expression is @italic{not} in @tech{tail +position} with respect to @racket[(- 4 (+ 1 1))]. To illustrate, we use the notation @sub[_C _expr] to mean the expression that is produced by -substituting @scheme[_expr] in place of @hole in the @tech{continuation} -@scheme[_C]: +substituting @racket[_expr] in place of @hole in the @tech{continuation} +@racket[_C]: -@schemeblock[ +@racketblock[ @#,sub[_C (- 4 (+ 1 1))] @#,reduces @#,sub[_C (- 4 2)] ] -In this case, the @tech{continuation} for reducing @scheme[(+ 1 1)] is -@sub[_C (+ 4 @#,hole)], not just @scheme[_C]. +In this case, the @tech{continuation} for reducing @racket[(+ 1 1)] is +@sub[_C (+ 4 @#,hole)], not just @racket[_C]. -In contrast, @scheme[(+ 1 1)] is in @tech{tail position} with respect -to @scheme[(if (zero? 0) (+ 1 1) 3)], because, for any continuation -@scheme[_C], +In contrast, @racket[(+ 1 1)] is in @tech{tail position} with respect +to @racket[(if (zero? 0) (+ 1 1) 3)], because, for any continuation +@racket[_C], -@schemeblock[ +@racketblock[ @#,sub[_C (if (zero? 0) (+ 1 1) 3)] @#,reduces @#,sub[_C (if #t (+ 1 1) 3)] @#,reduces @#,sub[_C (+ 1 1)] ] The steps in this reduction sequence are driven by the definition of -@scheme[if], and they do not depend on the @tech{continuation} -@scheme[_C]. The ``then'' branch of an @scheme[if] form is always in -@tech{tail position} with respect to the @scheme[if] form. Due to a -similar reduction rule for @scheme[if] and @scheme[#f], the ``else'' -branch of an @scheme[if] form is also in @tech{tail position}. +@racket[if], and they do not depend on the @tech{continuation} +@racket[_C]. The ``then'' branch of an @racket[if] form is always in +@tech{tail position} with respect to the @racket[if] form. Due to a +similar reduction rule for @racket[if] and @racket[#f], the ``else'' +branch of an @racket[if] form is also in @tech{tail position}. @tech{Tail-position} specifications provide a guarantee about the asymptotic space consumption of a computation. In general, the specification of @tech{tail positions} goes with each syntactic form, -like @scheme[if]. +like @racket[if]. @;------------------------------------------------------------------------ @section[#:tag "values-model"]{Multiple Return Values} -A Scheme expression can evaluate to @deftech{multiple values}, in the +A Racket expression can evaluate to @deftech{multiple values}, in the same way that a procedure can accept multiple arguments. Most @tech{continuations} expect a particular number of result -@tech{values}. Indeed, most @tech{continuations}, such as @scheme[(+ +@tech{values}. Indeed, most @tech{continuations}, such as @racket[(+ @#,hole 1)] expect a single @tech{value}. The @tech{continuation} -@scheme[(let-values ([(x y) @#,hole]) _expr)] expects two result -@tech{values}; the first result replaces @scheme[x] in the body -@scheme[_expr], and the second replaces @scheme[y] in -@scheme[_expr]. The @tech{continuation} @scheme[(begin @#,hole (+ 1 +@racket[(let-values ([(x y) @#,hole]) _expr)] expects two result +@tech{values}; the first result replaces @racket[x] in the body +@racket[_expr], and the second replaces @racket[y] in +@racket[_expr]. The @tech{continuation} @racket[(begin @#,hole (+ 1 2))] accepts any number of result @tech{values}, because it ignores the result(s). In general, the specification of a syntactic form inidicates the number of @tech{values} that it produces and the number that it expects from each of its sub-expression. In addtion, some procedures -(notably @scheme[values]) produce multiple @tech{values}, and some -procedures (notably @scheme[call-with-values]) create continuations +(notably @racket[values]) produce multiple @tech{values}, and some +procedures (notably @racket[call-with-values]) create continuations internally that accept a certain number of @tech{values}. @;------------------------------------------------------------------------ @@ -158,28 +158,28 @@ then an algebra student simplifies @tt{x + 1} as follows: @verbatim{ x + 1 = 10 + 1 = 11} -Scheme works much the same way, in that a set of @tech{top-level +Racket works much the same way, in that a set of @tech{top-level variables} are available for substitutions on demand during evaluation. For example, given -@schemeblock[ +@racketblock[ (define x 10) ] then -@schemeblock[ +@racketblock[ #,(redex (+ x 1)) #,reduces #,(redex (+ 10 1)) #,reduces 11 ] -In Scheme, the way definitions appear is just as important as the way -that they are used. Scheme evaluation thus keeps track of both +In Racket, the way definitions appear is just as important as the way +that they are used. Racket evaluation thus keeps track of both definitions and the current expression, and it extends the set of -definitions in response to evaluating forms such as @scheme[define]. +definitions in response to evaluating forms such as @racket[define]. Each evaluation step, then, takes the current set of definitions and program to a new set of definitions and program. Before a -@scheme[define] can be moved into the set of definitions, its +@racket[define] can be moved into the set of definitions, its right-hand expression must be reduced to a @tech{value}. @prog-steps/no-obj[ @@ -197,7 +197,7 @@ right-hand expression must be reduced to a @tech{value}. 11] ] -Using @scheme[set!], a program can change the value associated with an +Using @racket[set!], a program can change the value associated with an existing @tech{top-level variable}: @prog-steps/no-obj[ @@ -214,9 +214,9 @@ existing @tech{top-level variable}: @;------------------------------------------------------------------------ @section{Objects and Imperative Update} -In addition to @scheme[set!] for imperative update of @tech{top-level +In addition to @racket[set!] for imperative update of @tech{top-level variables}, various procedures enable the modification of elements -within a compound data structure. For example, @scheme[vector-set!] +within a compound data structure. For example, @racket[vector-set!] modifies the content of a vector. To allow such modifications to data, we must distingiush between @@ -224,16 +224,16 @@ To allow such modifications to data, we must distingiush between @deftech{objects}, which hold the data referenced by a value. A few kinds of @tech{objects} can serve directly as values, including -booleans, @scheme[(void)], and small exact integers. More generally, +booleans, @racket[(void)], and small exact integers. More generally, however, a @tech{value} is a reference to an @tech{object}. For example, a @tech{value} can be a reference to a particular vector that -currently holds the value @scheme[10] in its first slot. If an +currently holds the value @racket[10] in its first slot. If an @tech{object} is modified, then the modification is visible through all copies of the @tech{value} that reference the same @tech{object}. In the evaluation model, a set of @tech{objects} must be carried along with each step in evaluation, just like the definition set. Operations -that create @tech{objects}, such as @scheme[vector], add to the set of +that create @tech{objects}, such as @racket[vector], add to the set of @tech{objects}: @prog-steps[ @@ -306,35 +306,35 @@ reference is crucial. A @tech{top-level variable} is not a value is extracted from the current set of definitions. An object reference, in contrast is a value, and therefore needs no further evaluation. The model evaluation steps above use angle-bracketed -@scheme[] for an object reference to distinguish it from a +@racket[] for an object reference to distinguish it from a @tech{variable} name. A direct object reference can never appear in a text-based source program. A program representation created with -@scheme[datum->syntax-object], however, can embed direct references to +@racket[datum->syntax], however, can embed direct references to existing @tech{objects}. @;------------------------------------------------------------------------ @section[#:tag "model-eq"]{Object Identity and Comparisons} -The @scheme[eq?] operator compares two @tech{values}, returning -@scheme[#t] when the values refer to the same @tech{object}. This form +The @racket[eq?] operator compares two @tech{values}, returning +@racket[#t] when the values refer to the same @tech{object}. This form of equality is suitable for comparing objects that support imperative update (e.g., to determine that the effect of modifying an object through one reference is visible through another reference). Also, an -@scheme[eq?] test evaluates quickly, and @scheme[eq?]-based hashing -is more lightweight than @scheme[equal?]-based hashing in hash tables. +@racket[eq?] test evaluates quickly, and @racket[eq?]-based hashing +is more lightweight than @racket[equal?]-based hashing in hash tables. -In some cases, however, @scheme[eq?] is unsuitable as a comparison +In some cases, however, @racket[eq?] is unsuitable as a comparison operator, because the generation of @tech{objects} is not clearly -defined. In particular, two applications of @scheme[+] to the same two -exact integers may or may not produce results that are @scheme[eq?], -although the results are always @scheme[equal?]. Similarly, evaluation -of a @scheme[lambda] form typically generates a new procedure +defined. In particular, two applications of @racket[+] to the same two +exact integers may or may not produce results that are @racket[eq?], +although the results are always @racket[equal?]. Similarly, evaluation +of a @racket[lambda] form typically generates a new procedure @tech{object}, but it may re-use a procedure @tech{object} previously -generated by the same source @scheme[lambda] form. +generated by the same source @racket[lambda] form. -The behavior of a datatype with respect to @scheme[eq?] is generally +The behavior of a datatype with respect to @racket[eq?] is generally specified with the datatype and its associated procedures. @;------------------------------------------------------------------------ @@ -352,9 +352,9 @@ In the program state (+ 1 x)] ] -evaluation cannot depend on @scheme[], because it is not part of +evaluation cannot depend on @racket[], because it is not part of the program to evaluate, and it is not referenced by any definition -that is accessible in the program. The @tech{object} @scheme[] may +that is accessible in the program. The @tech{object} @racket[] may therefore be removed from the evaluation by @deftech{garbage collection}. @@ -364,17 +364,17 @@ collector in determining which @tech{objects} are reachable for the remainder of the computation. If an @tech{object} is reachable only via a @tech{weak reference}, then the object can be reclaimed, and the @tech{weak reference} is replaced by a different @tech{value} -(typically @scheme[#f]). +(typically @racket[#f]). As a special case, a @tech{fixnum} is always considered reachable by the garbage collector. Many other values are always reachable due to the way they are implemented and used: A @tech{character} in the -Latin-1 range is always reachable, because @scheme[equal?] Latin-1 -characters are always @scheme[eq?], and all of the Latin-1 characters -are referenced by an internal module. Similarly, @scheme[null], -@scheme[#t], @scheme[#f], @scheme[eof], and @|void-const| and are -always reachable. Values produced by @scheme[quote] remain reachable -when the @scheme[quote] expression itself is reachable. +Latin-1 range is always reachable, because @racket[equal?] Latin-1 +characters are always @racket[eq?], and all of the Latin-1 characters +are referenced by an internal module. Similarly, @racket[null], +@racket[#t], @racket[#f], @racket[eof], and @|void-const| and are +always reachable. Values produced by @racket[quote] remain reachable +when the @racket[quote] expression itself is reachable. @;------------------------------------------------------------------------ @section{Procedure Applications and Local Variables} @@ -391,8 +391,8 @@ The key step in this simplification is take the body of the defined function @tt{f}, and then replace each @tt{x} with the actual @tech{value} @tt{1}. -Scheme procedure application works much the same way. A procedure is -an @tech{object}, so evaluating @scheme[(f 7)] starts with a +Racket procedure application works much the same way. A procedure is +an @tech{object}, so evaluating @racket[(f 7)] starts with a @tech{variable} lookup: @prog-steps[ @@ -406,9 +406,9 @@ an @tech{object}, so evaluating @scheme[(f 7)] starts with a Unlike in algebra, however, the @tech{value} associated with an argument can be changed in the body of a procedure by using -@scheme[set!], as in the example @scheme[(lambda (x) (begin (set! x 3) -x))]. Since the @tech{value} associated with @scheme[x] can be -changed, an actual value for cannot be substituted for @scheme[x] when +@racket[set!], as in the example @racket[(lambda (x) (begin (set! x 3) +x))]. Since the @tech{value} associated with @racket[x] can be +changed, an actual value for cannot be substituted for @racket[x] when the procedure is applied. Instead, a new @deftech{location} is created for each @tech{variable} @@ -439,10 +439,10 @@ a @tech{location} is generated, it (conceptually) uses a name that has not been used before and that cannot not be generated again or accessed directly. -Generating a @tech{location} in this way means that @scheme[set!] +Generating a @tech{location} in this way means that @racket[set!] evaluates for @tech{local variables} in the same way as for @tech{top-level variables}, because the @tech{local variable} is -always replaced with a @tech{location} by the time the @scheme[set!] +always replaced with a @tech{location} by the time the @racket[set!] form is evaluated: @prog-steps[ @@ -472,16 +472,16 @@ form is evaluated: The substitution and @tech{location}-generation step of procedure application requires that the argument is a @tech{value}. Therefore, -in @scheme[((lambda (x) (+ x 10)) (+ 1 2))], the @scheme[(+ 1 2)] -sub-expression must be simplified to the @tech{value} @scheme[3], and -then @scheme[3] can be placed into a @tech{location} for -@scheme[x]. In other words, Scheme is a @deftech{call-by-value} +in @racket[((lambda (x) (+ x 10)) (+ 1 2))], the @racket[(+ 1 2)] +sub-expression must be simplified to the @tech{value} @racket[3], and +then @racket[3] can be placed into a @tech{location} for +@racket[x]. In other words, Racket is a @deftech{call-by-value} language. -Evaluation of a local-variable form, such as @scheme[(let ([x (+ 1 -2)]) _expr)], is the same as for a procedure call. After @scheme[(+ 1 +Evaluation of a local-variable form, such as @racket[(let ([x (+ 1 +2)]) _expr)], is the same as for a procedure call. After @racket[(+ 1 2)] produces a @tech{value}, it is stored in a fresh @tech{location} -that replaces every instance of @scheme[x] in @scheme[_expr]. +that replaces every instance of @racket[x] in @racket[_expr]. @;------------------------------------------------------------------------ @section{Variables and Locations} @@ -498,20 +498,20 @@ through different instantiations. For example, in the program -@schemeblock[(define y (+ (let ([x 5]) x) 6))] +@racketblock[(define y (+ (let ([x 5]) x) 6))] -both @scheme[y] and @scheme[x] are @tech{variables}. The @scheme[y] -@tech{variable} is a @tech{top-level variable}, and the @scheme[x] is +both @racket[y] and @racket[x] are @tech{variables}. The @racket[y] +@tech{variable} is a @tech{top-level variable}, and the @racket[x] is a @tech{local variable}. When this code is evaluated, a -@tech{location} is created for @scheme[x] to hold the value -@scheme[5], and a @tech{location} is also created for @scheme[y] to -hold the value @scheme[6]. +@tech{location} is created for @racket[x] to hold the value +@racket[5], and a @tech{location} is also created for @racket[y] to +hold the value @racket[6]. The replacement of a @tech{variable} with a @tech{location} during -evaluation implements Scheme's @deftech{lexical scoping}. For example, -when a procedure-argument @tech{variable} @scheme[x] is replaced by -the @tech{location} @scheme[xloc], then it is replaced throughout the -body of the procedure, including with any nested @scheme[lambda] +evaluation implements Racket's @deftech{lexical scoping}. For example, +when a procedure-argument @tech{variable} @racket[x] is replaced by +the @tech{location} @racket[xloc], then it is replaced throughout the +body of the procedure, including with any nested @racket[lambda] forms. As a result, future references of the @tech{variable} always access the same @tech{location}. @@ -520,7 +520,7 @@ access the same @tech{location}. @margin-note/ref{See @secref["module"] for the syntax of modules.} -Most definitions in PLT Scheme are in modules. In terms of evaluation, +Most definitions in Racket are in modules. In terms of evaluation, a module is essentially a prefix on a defined name, so that different modules can define the name. That is, a @deftech{module-level variable} is like a @tech{top-level variable} from the perspective of @@ -528,57 +528,57 @@ evaluation. One difference between a module and a top-level definition is that a module can be declared without instantiating its module-level -definitions. Evaluation of a @scheme[require] @deftech{instantiates} +definitions. Evaluation of a @racket[require] @deftech{instantiates} (i.e., triggers the @deftech{instantiation} of) a declared module, which creates variables that correspond to its module-level definitions. For example, given the module declaration -@schemeblock[ -(module m scheme +@racketblock[ +(module m racket (define x 10)) ] -the evaluation of @scheme[(require m)] creates the variable @scheme[x] -and installs @scheme[10] as its value. This @scheme[x] is unrelated to -any top-level definition of @scheme[x]. +the evaluation of @racket[(require m)] creates the variable @racket[x] +and installs @racket[10] as its value. This @racket[x] is unrelated to +any top-level definition of @racket[x]. @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsection[#:tag "module-phase"]{Phases} A module can be @tech{instantiate}d in multiple @deftech{phases}. A phase is an integer that, again, is effectively a prefix on the names -of module-level definitions. A top-level @scheme[require] +of module-level definitions. A top-level @racket[require] @tech{instantiates} a module at @tech{phase} 0, if the module is not already @tech{instantiate}d at phase 0. A top-level -@scheme[(require (for-syntax ....))] @tech{instantiates} a module at +@racket[(require (for-syntax ....))] @tech{instantiates} a module at @tech{phase} 1 (if it is not already @tech{instantiate}d at that -level); @scheme[for-syntax] also has a different binding +level); @racket[for-syntax] also has a different binding effect on further program parsing, as described in @secref["intro-binding"]. Within a module, some definitions are shifted by a phase already; the -@scheme[define-for-syntax] form is like @scheme[define], but it +@racket[define-for-syntax] form is like @racket[define], but it defines a variable at relative @tech{phase} 1, instead of relative @tech{phase} 0. Thus, if the module is @tech{instantiate}d at phase 1, -the variables for @scheme[define-for-syntax] are created at phase 2, +the variables for @racket[define-for-syntax] are created at phase 2, and so on. Moreover, this relative phase acts as another layer of -prefixing, so that a @scheme[define] of @scheme[x] and a -@scheme[define-for-syntax] of @scheme[x] can co-exist in a module +prefixing, so that a @racket[define] of @racket[x] and a +@racket[define-for-syntax] of @racket[x] can co-exist in a module without colliding. Again, the higher phases are mainly related to program parsing, instead of normal evaluation. If a module @tech{instantiate}d at @tech{phase} @math{n} -@scheme[require]s another module, then the @scheme[require]d module is +@racket[require]s another module, then the @racket[require]d module is first @tech{instantiate}d at phase @math{n}, and so on -transitively. (Module @scheme[require]s cannot form cycles.) If a -module @tech{instantiate}d at phase @math{n} @scheme[require]s -@scheme[for-syntax] another module, the other module becomes +transitively. (Module @racket[require]s cannot form cycles.) If a +module @tech{instantiate}d at phase @math{n} @racket[require]s +@racket[for-syntax] another module, the other module becomes @deftech{available} at @tech{phase} @math{n+1}, and it may later be @tech{instantiate}d at @tech{phase} @math{n+1}. If a module that is -@tech{available} at phase @math{n} for @math{n>0} @scheme[require]s -@scheme[for-template] another module, the other module becomes +@tech{available} at phase @math{n} for @math{n>0} @racket[require]s +@racket[for-template] another module, the other module becomes @tech{available} at @tech{phase} @math{n-1}, and so on. @tech{Instantiation}s of @tech{available} modules above @tech{phase} 0 are triggered on demand as described in @@ -591,11 +591,11 @@ module forms (see @secref["mod-parse"]), and are, again, conceptually distinguished by prefixes. Top-level variables can exist in multiple phases in the same way as -within modules. For example, @scheme[define-for-syntax] creates a +within modules. For example, @racket[define-for-syntax] creates a @tech{phase} 1 variable. Furthermore, reflective operations like -@scheme[make-base-namespace] and @scheme[eval] provide access to +@racket[make-base-namespace] and @racket[eval] provide access to top-level variables in higher @tech{phases}, while module -@tech{instantiations} (triggered by with @scheme[require]) relative to such +@tech{instantiations} (triggered by with @racket[require]) relative to such top-levels are in corresponding higher @tech{phase}s. @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -620,9 +620,9 @@ re-declared, each re-declaration of the module is immediately @margin-note/ref{See @secref["contmarks"] for continuation-mark forms and functions.} -Every continuation @scheme[_C] can be partitioned into +Every continuation @racket[_C] can be partitioned into @deftech{continuation frames} @frame[1], @frame[2], ..., @frame["n"] -such that @scheme[_C] = @*sub[@frame[1] @*sub[@frame[2] @*sub["..." +such that @racket[_C] = @*sub[@frame[1] @*sub[@frame[2] @*sub["..." @frame["n"]]]], and no frame @frame["i"] can be itself partitioned into smaller continuations. Evaluation steps add and remove frames to the current continuation, typically one at a time. @@ -675,13 +675,13 @@ escape-continuation aborts can cross continuation barriers. @margin-note/ref{See @secref["concurrency"] for thread and synchronization functions.} -Scheme supports multiple @deftech{threads} of evaluation. Threads run +Racket supports multiple @deftech{threads} of evaluation. Threads run concurrently, in the sense that one thread can preempt another without its cooperation, but threads currently all run on the same processor (i.e., the same underlying OS process and thread). See also @secref["futures"]. -Threads are created explicitly by functions such as @scheme[thread]. +Threads are created explicitly by functions such as @racket[thread]. In terms of the evaluation model, each step in evaluation actually consists of multiple concurrent expressions, up to one per thread, rather than a single expression. The expressions all share the same objects and top-level variables, so that they can @@ -705,7 +705,7 @@ is created) as all other threads. @margin-note/ref{See @secref["parameters"] for parameter forms and functions.} -@deftech{Parameters} are essentially a derived concept in Scheme; they +@deftech{Parameters} are essentially a derived concept in Racket; they are defined in terms of @tech{continuation marks} and @tech{thread cells}. However, parameters are also built in, in the sense that some primitive procedures consult parameter values. For example, the @@ -726,8 +726,8 @@ preserved thread cell, and the combination of thread cell and current thread yields the parameter's value. A parameter procedure sets or accesses the relevant thread cell for its parameter. -Various operations, such as @scheme[parameterize] or -@scheme[call-with-parameterization], install a parameterization into +Various operations, such as @racket[parameterize] or +@racket[call-with-parameterization], install a parameterization into the current continuation's frame. @;------------------------------------------------------------------------ @@ -735,7 +735,7 @@ the current continuation's frame. @margin-note/ref{See @secref["exns"] for exception forms, functions, and types.} -@deftech{Exceptions} are essentially a derived concept in Scheme; they +@deftech{Exceptions} are essentially a derived concept in Racket; they are defined in terms of continuations, prompts, and continuation marks. However, exceptions are also built in, in the sense that primitive forms and procedures may raise exceptions. @@ -763,7 +763,7 @@ A @deftech{custodian} manages a collection of threads, @tech{file-stream ports}, TCP ports, @tech{TCP listeners}, @tech{UDP sockets}, and @tech{byte converters}. Whenever a thread, etc. is created, it is placed under the management of the @deftech{current -custodian} as determined by the @scheme[current-custodian] +custodian} as determined by the @racket[current-custodian] @tech{parameter}. @margin-note{In MrEd, custodians also manage eventspaces.} @@ -774,20 +774,20 @@ Every object managed by a subordinate custodian is also managed by the custodian's owner. When a @tech{custodian} is shut down via -@scheme[custodian-shutdown-all], it forcibly and immediately closes +@racket[custodian-shutdown-all], it forcibly and immediately closes the ports, TCP connections, etc. that it manages, as well as terminating (or suspending) its threads. A custodian that has been shut down cannot manage new objects. If the current custodian is shut down before a procedure is called to create a managed resource (e.g., -@scheme[open-input-port], @scheme[thread]), the +@racket[open-input-port], @racket[thread]), the @exnraise[exn:fail:contract]. A thread can have multiple managing custodians, and a suspended thread -created with @scheme[thread/suspend-to-kill] can have zero +created with @racket[thread/suspend-to-kill] can have zero custodians. Extra custodians become associated with a thread through -@scheme[thread-resume] (see @secref["threadkill"]). When a thread +@racket[thread-resume] (see @secref["threadkill"]). When a thread has multiple custodians, it is not necessarily killed by a -@scheme[custodian-shutdown-all], but shut-down custodians are removed +@racket[custodian-shutdown-all], but shut-down custodians are removed from the thread's managing set, and the thread is killed when its managing set becomes empty. @@ -800,15 +800,15 @@ collected, at which point its subordinates become immediately subordinate to the collected custodian's superordinate custodian. In addition to the other entities managed by a custodian, a -@deftech{custodian box} created with @scheme[make-custodian-box] +@deftech{custodian box} created with @racket[make-custodian-box] strongly holds onto a value placed in the box until the box's custodian is shut down. The custodian only weakly retains the box itself, however (so the box and its content can be collected if there are no other references to them). -When PLT Scheme is compiled with support for per-custodian memory -accounting (see @scheme[custodian-memory-accounting-available?]), the -@scheme[current-memory-use] procedure can report a custodian-specific +When Racket is compiled with support for per-custodian memory +accounting (see @racket[custodian-memory-accounting-available?]), the +@racket[current-memory-use] procedure can report a custodian-specific result. This result determines how much memory is occupied by objects that are reachable from the custodian's managed values, especially its threads, and including its sub-custodians' managed values. If an diff --git a/collects/scribblings/reference/prog-steps.ss b/collects/scribblings/reference/prog-steps.ss index abb60ee481..8b0dab6286 100644 --- a/collects/scribblings/reference/prog-steps.ss +++ b/collects/scribblings/reference/prog-steps.ss @@ -43,7 +43,7 @@ (define (*prog-steps cont? objs defs progs) (make-table - '((valignment top top top top top top)) + '((valignment baseline baseline baseline baseline baseline baseline)) (apply append (for/list ([obj (or objs (in-naturals))] diff --git a/collects/scribblings/reference/syntax-model.scrbl b/collects/scribblings/reference/syntax-model.scrbl index ed9f3a481d..2fd384d80d 100644 --- a/collects/scribblings/reference/syntax-model.scrbl +++ b/collects/scribblings/reference/syntax-model.scrbl @@ -3,13 +3,13 @@ (for-syntax mzscheme) "mz.ss") -@(define scheme-eval (make-base-eval)) -@(interaction-eval #:eval scheme-eval (require (for-syntax racket/base))) +@(define racket-eval (make-base-eval)) +@(interaction-eval #:eval racket-eval (require (for-syntax racket/base))) @;------------------------------------------------------------------------ @title[#:tag "syntax-model"]{Syntax Model} -The syntax of a Scheme program is defined by +The syntax of a Racket program is defined by @itemize[ @@ -22,7 +22,7 @@ The syntax of a Scheme program is defined by ] For details on the @tech{read} phase, see @secref["reader"]. Source -code is normally read in @scheme[read-syntax] mode, which produces a +code is normally read in @racket[read-syntax] mode, which produces a @tech{syntax object}. The @tech{expand} phase recursively processes a @tech{syntax object} @@ -38,7 +38,7 @@ new binding information. @guideintro["binding"]{binding} An @deftech{identifier} is source-program entity. Parsing (i.e., -expanding) a Scheme program reveals that some @tech{identifiers} +expanding) a Racket program reveals that some @tech{identifiers} correspond to @tech{variables}, some refer to syntactic forms, and some are quoted to produce a symbol or a syntax object. @@ -55,13 +55,13 @@ uses of an @tech{identifier} refer to the @tech{shadowing} For example, as a bit of source, the text -@schemeblock[(let ([x 5]) x)] +@racketblock[(let ([x 5]) x)] -includes two @tech{identifiers}: @scheme[let] and @scheme[x] (which +includes two @tech{identifiers}: @racket[let] and @racket[x] (which appears twice). When this source is parsed in a typical -@tech{environment}, @scheme[x] turns out to represent a -@tech{variable} (unlike @scheme[let]). In particular, the first -@scheme[x] @tech{binds} the second @scheme[x]. +@tech{environment}, @racket[x] turns out to represent a +@tech{variable} (unlike @racket[let]). In particular, the first +@racket[x] @tech{binds} the second @racket[x]. A @deftech{top-level binding} is a @tech{binding} from a definition at the top-level; a @deftech{module binding} is a binding from a @@ -73,10 +73,10 @@ identifiers are called @tech{unbound} in a module context. Throughout the documentation, @tech{identifiers} are typeset to suggest the way that they are parsed. A black, boldface -@tech{identifier} like @scheme[lambda] indicates as a reference to a -syntactic form. A plain blue @tech{identifier} like @schemeidfont{x} +@tech{identifier} like @racket[lambda] indicates as a reference to a +syntactic form. A plain blue @tech{identifier} like @racketidfont{x} is a @tech{variable} or a reference to an unspecified @tech{top-level -variable}. A hyperlinked @tech{identifier} @scheme[cons] is a +variable}. A hyperlinked @tech{identifier} @racket[cons] is a reference to a specific @tech{top-level variable}. Every binding has a @deftech{phase level} in which it can be @@ -108,17 +108,17 @@ different phase levels. @;------------------------------------------------------------------------ @section[#:tag "stxobj-model"]{Syntax Objects} -A @deftech{syntax object} combines a simpler Scheme value, such as a +A @deftech{syntax object} combines a simpler Racket value, such as a symbol or pair, with @deftech{lexical information} about bindings, source-location information, @tech{syntax properties}, and @tech{syntax certificates}. In particular, an @tech{identifier} is represented as a symbol object that combines a symbol and lexical and other information. -For example, a @schemeidfont{car} @tech{identifier} might have -@tech{lexical information} that designates it as the @scheme[car] from -the @schememodname[racket/base] language (i.e., the built-in -@scheme[car]). Similarly, a @schemeidfont{lambda} identifier's +For example, a @racketidfont{car} @tech{identifier} might have +@tech{lexical information} that designates it as the @racket[car] from +the @racketmodname[racket/base] language (i.e., the built-in +@racket[car]). Similarly, a @racketidfont{lambda} identifier's @tech{lexical information} may indicate that it represents a procedure form. Some other @tech{identifier}'s @tech{lexical information} may indicate that it references a @tech{top-level variable}. @@ -128,42 +128,42 @@ an @tech{identifier} or simple constant, its internal components can be extracted. Even for extracted identifier, detailed information about binding is available mostly indirectly; two identifiers can be compared to see if they refer to the same binding (i.e., -@scheme[free-identifier=?]), or whether each identifier would bind the +@racket[free-identifier=?]), or whether each identifier would bind the other if one was in a binding position and the other in an expression -position (i.e., @scheme[bound-identifier=?]). +position (i.e., @racket[bound-identifier=?]). For example, the when the program written as -@schemeblock[(let ([x 5]) (+ x 6))] +@racketblock[(let ([x 5]) (+ x 6))] is represented as a @tech{syntax object}, then two @tech{syntax -objects} can be extracted for the two @scheme[x]s. Both the -@scheme[free-identifier=?] and @scheme[bound-identifier=?] predicates -will indicate that the @scheme[x]s are the same. In contrast, the -@scheme[let] @tech{identifier} is not @scheme[free-identifier=?] or -@scheme[bound-identifier=?] to either @scheme[x]. +objects} can be extracted for the two @racket[x]s. Both the +@racket[free-identifier=?] and @racket[bound-identifier=?] predicates +will indicate that the @racket[x]s are the same. In contrast, the +@racket[let] @tech{identifier} is not @racket[free-identifier=?] or +@racket[bound-identifier=?] to either @racket[x]. The @tech{lexical information} in a @tech{syntax object} is independent of the other half, and it can be copied to a new syntax -object in combination with an arbitrary other Scheme value. Thus, +object in combination with an arbitrary other Racket value. Thus, identifier-@tech{binding} information in a @tech{syntax object} is predicated on the symbolic name of the @tech{identifier} as well as the identifier's @tech{lexical information}; the same question with the same @tech{lexical information} but different base value can produce a different answer. -For example, combining the lexical information from @scheme[let] in -the program above to @scheme['x] would not produce an identifier that -is @scheme[free-identifier=?] to either @scheme[x], since it does not -appear in the scope of the @scheme[x] binding. Combining the lexical -context of the @scheme[6] with @scheme['x], in contrast, would produce -an identifier that is @scheme[bound-identifier=?] to both @scheme[x]s. +For example, combining the lexical information from @racket[let] in +the program above to @racket['x] would not produce an identifier that +is @racket[free-identifier=?] to either @racket[x], since it does not +appear in the scope of the @racket[x] binding. Combining the lexical +context of the @racket[6] with @racket['x], in contrast, would produce +an identifier that is @racket[bound-identifier=?] to both @racket[x]s. -The @scheme[quote-syntax] form bridges the evaluation of a program and -the representation of a program. Specifically, @scheme[(quote-syntax +The @racket[quote-syntax] form bridges the evaluation of a program and +the representation of a program. Specifically, @racket[(quote-syntax _datum)] produces a syntax object that preserves all of the lexical -information that @scheme[_datum] had when it was parsed as part of the -@scheme[quote-syntax] form. +information that @racket[_datum] had when it was parsed as part of the +@racket[quote-syntax] form. @;------------------------------------------------------------------------ @section[#:tag "expansion"]{Expansion@aux-elem{ (Parsing)}} @@ -184,7 +184,7 @@ following grammar: @margin-note{Beware that the symbolic names of identifiers in a fully expanded program may not match the symbolic names in the grammar. Only -the binding (according to @scheme[free-identifier=?]) matters.} +the binding (according to @racket[free-identifier=?]) matters.} @schemegrammar*[ #:literals (#%expression module #%plain-module-begin begin #%provide @@ -217,7 +217,7 @@ the binding (according to @scheme[free-identifier=?]) matters.} (letrec-values (((id ...) expr) ...) expr ...+) (set! id expr) - (@#,scheme[quote] datum) + (@#,racket[quote] datum) (quote-syntax datum) (with-continuation-mark expr expr expr) (#%plain-app expr ...+) @@ -235,29 +235,29 @@ information} on its @tech{identifiers} indicates the @tech{parse}. More specifically, the typesetting of identifiers in the above grammar -is significant. For example, the second case for @scheme[_expr] is a +is significant. For example, the second case for @racket[_expr] is a @tech{syntax-object} list whose first element is an @tech{identifier}, where the @tech{identifier}'s @tech{lexical information} specifies a -binding to the @scheme[#%plain-lambda] of the -@schememodname[racket/base] language (i.e., the @tech{identifier} is -@scheme[free-identifier=?] to one whose binding is -@scheme[#%plain-lambda]). In all cases, identifiers above typeset as +binding to the @racket[#%plain-lambda] of the +@racketmodname[racket/base] language (i.e., the @tech{identifier} is +@racket[free-identifier=?] to one whose binding is +@racket[#%plain-lambda]). In all cases, identifiers above typeset as syntactic-form names refer to the bindings defined in @secref["syntax"]. Only @tech{phase levels} 0 and 1 are relevant for the parse of a -program (though the @scheme[_datum] in a @scheme[quote-syntax] form +program (though the @racket[_datum] in a @racket[quote-syntax] form preserves its information for all @tech{phase level}s). In particular, -the relevant @tech{phase level} is 0, except for the @scheme[_expr]s -in a @scheme[define-syntax], @scheme[define-syntaxes], -@scheme[define-for-syntax], or @scheme[define-values-for-syntax] form, +the relevant @tech{phase level} is 0, except for the @racket[_expr]s +in a @racket[define-syntax], @racket[define-syntaxes], +@racket[define-for-syntax], or @racket[define-values-for-syntax] form, in which case the relevant @tech{phase level} is 1 (for which -comparisons are made using @scheme[free-transformer-identifier=?] -instead of @scheme[free-identifier=?]). +comparisons are made using @racket[free-transformer-identifier=?] +instead of @racket[free-identifier=?]). -In addition to the grammar above, @scheme[letrec-syntaxes+values] can +In addition to the grammar above, @racket[letrec-syntaxes+values] can appear in a fully local-expanded expression, such as the result from -@scheme[local-expand] when the stop list is empty. +@racket[local-expand] when the stop list is empty. @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsection[#:tag "expand-steps"]{Expansion Steps} @@ -274,15 +274,15 @@ the @tech{syntax object} being expanded: @tech{binding} other than as a @tech{top-level variable}, that @tech{binding} is used to continue. If the @tech{identifier} has no @tech{binding}, a new @tech{syntax-object} symbol - @scheme['#%top] is created using the @tech{lexical information} - of the @tech{identifier}; if this @schemeidfont{#%top} + @racket['#%top] is created using the @tech{lexical information} + of the @tech{identifier}; if this @racketidfont{#%top} @tech{identifier} has no @tech{binding} (other than as a @tech{top-level variable}), then parsing fails with an - @scheme[exn:fail:syntax] exception. Otherwise, the new + @racket[exn:fail:syntax] exception. Otherwise, the new @tech{identifier} is combined with the original @tech{identifier} in a new @tech{syntax-object} pair (also using the same @tech{lexical information} as the original - @tech{identifier}), and the @schemeidfont{#%top} @tech{binding} + @tech{identifier}), and the @racketidfont{#%top} @tech{binding} is used to continue.} @item{If it is a @tech{syntax-object} pair whose first element is an @@ -291,26 +291,26 @@ the @tech{syntax object} being expanded: the @tech{identifier}'s @tech{binding} is used to continue.} @item{If it is a @tech{syntax-object} pair of any other form, then a - new @tech{syntax-object} symbol @scheme['#%app] is created + new @tech{syntax-object} symbol @racket['#%app] is created using the @tech{lexical information} of the pair. If the - resulting @schemeidfont{#%app} @tech{identifier} has no - binding, parsing fails with an @scheme[exn:fail:syntax] + resulting @racketidfont{#%app} @tech{identifier} has no + binding, parsing fails with an @racket[exn:fail:syntax] exception. Otherwise, the new @tech{identifier} is combined with the original pair to form a new @tech{syntax-object} pair (also using the same @tech{lexical information} as the original - pair), and the @schemeidfont{#%app} @tech{binding} is used to + pair), and the @racketidfont{#%app} @tech{binding} is used to continue.} @item{If it is any other syntax object, then a new - @tech{syntax-object} symbol @scheme['#%datum] is created using + @tech{syntax-object} symbol @racket['#%datum] is created using the @tech{lexical information} of the original @tech{syntax - object}. If the resulting @schemeidfont{#%datum} + object}. If the resulting @racketidfont{#%datum} @tech{identifier} has no @tech{binding}, parsing fails with an - @scheme[exn:fail:syntax] exception. Otherwise, the new + @racket[exn:fail:syntax] exception. Otherwise, the new @tech{identifier} is combined with the original @tech{syntax object} in a new @tech{syntax-object} pair (using the same @tech{lexical information} as the original pair), and the - @schemeidfont{#%datum} @tech{binding} is used to continue.} + @racketidfont{#%datum} @tech{binding} is used to continue.} ] @@ -321,24 +321,24 @@ things: @itemize[ @item{A @tech{transformer binding}, such as introduced by - @scheme[define-syntax] or @scheme[let-syntax]. If the + @racket[define-syntax] or @racket[let-syntax]. If the associated value is a procedure of one argument, the procedure is called as a @tech{syntax transformer} (described below), and parsing starts again with the @tech{syntax-object} result. If the @tech{transformer binding} is to any other kind of value, - parsing fails with an @scheme[exn:fail:syntax] exception. The - call to the @tech{syntax transformer} is @scheme[parameterize]d - to set @scheme[current-namespace] to a @tech{namespace} that + parsing fails with an @racket[exn:fail:syntax] exception. The + call to the @tech{syntax transformer} is @racket[parameterize]d + to set @racket[current-namespace] to a @tech{namespace} that shares @tech{bindings} and @tech{variables} with the namespace being used to expand, except that its @tech{base phase} is one greater.} @item{A @tech{variable} @tech{binding}, such as introduced by a - module-level @scheme[define] or by @scheme[let]. In this case, + module-level @racket[define] or by @racket[let]. In this case, if the form being parsed is just an @tech{identifier}, then it is parsed as a reference to the corresponding @tech{variable}. If the form being parsed is a - @tech{syntax-object} pair, then an @scheme[#%app] is added to + @tech{syntax-object} pair, then an @racket[#%app] is added to the front of the @tech{syntax-object} pair in the same way as when the first item in the @tech{syntax-object} pair is not an identifier (third case in the previous enumeration), and @@ -357,7 +357,7 @@ things: Each expansion step occurs in a particular @deftech{context}, and transformers and core syntactic forms may expand differently for -different @tech{contexts}. For example, a @scheme[module] form is +different @tech{contexts}. For example, a @racket[module] form is allowed only in a @tech{top-level context}, and it fails in other contexts. The possible @tech{contexts} are as follows: @@ -365,7 +365,7 @@ contexts. The possible @tech{contexts} are as follows: @item{@deftech{top-level context} : outside of any module, definition, or expression, except that sub-expressions of a top-level - @scheme[begin] form are also expanded as top-level forms.} + @racket[begin] form are also expanded as top-level forms.} @item{@deftech{module-begin context} : inside the body of a module, as the only form within the module.} @@ -382,7 +382,7 @@ contexts. The possible @tech{contexts} are as follows: ] Different core @tech{syntactic forms} parse sub-forms using different -@tech{contexts}. For example, a @scheme[let] form always parses the +@tech{contexts}. For example, a @racket[let] form always parses the right-hand expressions of a binding in an @tech{expression context}, but it starts parsing the body in an @tech{internal-definition context}. @@ -395,58 +395,58 @@ core syntactic forms are encountered: @itemize[ - @item{When a @scheme[require] form is encountered at the top level or + @item{When a @racket[require] form is encountered at the top level or module level, all lexical information derived from the top level or the specific module's level are extended with bindings from the specified modules. If not otherwise indicated in the - @scheme[require] form, bindings are introduced at the + @racket[require] form, bindings are introduced at the @tech{phase level}s specified by the exporting modules: - @tech{phase level} 0 for each normal @scheme[provide], - @tech{phase level} 1 for each @scheme[for-syntax] - @scheme[provide], and so on. The @scheme[for-meta] - @scheme[provide] form allows exports at an arbitrary + @tech{phase level} 0 for each normal @racket[provide], + @tech{phase level} 1 for each @racket[for-syntax] + @racket[provide], and so on. The @racket[for-meta] + @racket[provide] form allows exports at an arbitrary @tech{phase level} (as long as a binding exists within the module at the @tech{phase level}). - A @scheme[for-syntax] sub-form within @scheme[require] imports + A @racket[for-syntax] sub-form within @racket[require] imports similarly, but the resulting bindings have a @tech{phase level} that is one more than the exported @tech{phase levels}, when exports for the @tech{label phase level} are still imported at the @tech{label phase level}. More generally, a - @scheme[for-meta] sub-form within @scheme[require] imports with + @racket[for-meta] sub-form within @racket[require] imports with the specified @tech{phase level} shift; if the specified shift - is @scheme[#f], or if @scheme[for-label] is used to import, + is @racket[#f], or if @racket[for-label] is used to import, then all bindings are imported into the @tech{label phase level}.} - @item{When a @scheme[define], @scheme[define-values], - @scheme[define-syntax], or @scheme[define-syntaxes] form is + @item{When a @racket[define], @racket[define-values], + @racket[define-syntax], or @racket[define-syntaxes] form is encountered at the top level or module level, all lexical information derived from the top level or the specific module's level is extended with bindings for the specified identifiers at @tech{phase level} 0 (i.e., the @tech{base environment} is extended).} - @item{When a @scheme[define-for-syntax] or - @scheme[define-values-for-syntax] form is encountered at the + @item{When a @racket[define-for-syntax] or + @racket[define-values-for-syntax] form is encountered at the top level or module level, bindings are introduced as for - @scheme[define-values], but at @tech{phase level} 1 (i.e., the + @racket[define-values], but at @tech{phase level} 1 (i.e., the @tech{transformer environment} is extended).} - @item{When a @scheme[let-values] form is encountered, the body of the - @scheme[let-values] form is extended (by creating new + @item{When a @racket[let-values] form is encountered, the body of the + @racket[let-values] form is extended (by creating new @tech{syntax objects}) with bindings for the specified identifiers. The same bindings are added to the identifiers themselves, so that the identifiers in binding position are - @scheme[bound-identifier=?] to uses in the fully expanded form, - and so they are not @scheme[bound-identifier=?] to other + @racket[bound-identifier=?] to uses in the fully expanded form, + and so they are not @racket[bound-identifier=?] to other identifiers. The bindings are available for use at the - @tech{phase level} at which the @scheme[let-values] form is + @tech{phase level} at which the @racket[let-values] form is expanded.} - @item{When a @scheme[letrec-values] or - @scheme[letrec-syntaxes+values] form is encountered, bindings - are added as for @scheme[let-values], except that the + @item{When a @racket[letrec-values] or + @racket[letrec-syntaxes+values] form is encountered, bindings + are added as for @racket[let-values], except that the right-hand-side expressions are also extended with the bindings.} @@ -457,26 +457,26 @@ core syntactic forms are encountered: A new binding in lexical information maps to a new variable. The identifiers mapped to this variable are those that currently have the -same binding (i.e., that are currently @scheme[bound-identifier=?]) to +same binding (i.e., that are currently @racket[bound-identifier=?]) to the identifier associated with the binding. For example, in -@schemeblock[ +@racketblock[ (let-values ([(x) 10]) (+ x y)) ] -the binding introduced for @scheme[x] applies to the @scheme[x] in the -body, but not the @scheme[y] n the body, because (at the point in -expansion where the @scheme[let-values] form is encountered) the -binding @scheme[x] and the body @scheme[y] are not -@scheme[bound-identifier=?]. +the binding introduced for @racket[x] applies to the @racket[x] in the +body, but not the @racket[y] n the body, because (at the point in +expansion where the @racket[let-values] form is encountered) the +binding @racket[x] and the body @racket[y] are not +@racket[bound-identifier=?]. @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsection[#:tag "transformer-model"]{Transformer Bindings} In a @tech{top-level context} or @tech{module context}, when the -expander encounters a @scheme[define-syntaxes] form, the binding that +expander encounters a @racket[define-syntaxes] form, the binding that it introduces for the defined identifiers is a @deftech{transformer binding}. The @tech{value} of the @tech{binding} exists at expansion time, rather than run time (though the two times can overlap), though @@ -484,13 +484,13 @@ the binding itself is introduced with @tech{phase level} 0 (i.e., in the @tech{base environment}). The @tech{value} for the binding is obtained by evaluating the -expression in the @scheme[define-syntaxes] form. This expression must +expression in the @racket[define-syntaxes] form. This expression must be @tech{expand}ed (i.e. parsed) before it can be evaluated, and it is expanded at @tech{phase level} 1 (i.e., in the @tech{transformer environment}) instead of @tech{phase level} 0. -If the resulting @scheme[value] is a procedure of one argument or -the result of @scheme[make-set!-transformer] on a procedure, then it +If the resulting @racket[value] is a procedure of one argument or +the result of @racket[make-set!-transformer] on a procedure, then it is used as a @deftech{syntax transformer} (a.k.a. @deftech{macro}). The procedure is expected to accept a syntax object and return a syntax object. A use of the binding (at @tech{phase level} 0) triggers @@ -503,7 +503,7 @@ applies to all sub-@tech{syntax objects}). The result of the transformer is similarly extended with the same @tech{syntax mark}. When a @tech{syntax object}'s @tech{lexical information} includes the same mark twice in a row, the marks effectively -cancel. Otherwise, two identifiers are @scheme[bound-identifier=?] +cancel. Otherwise, two identifiers are @racket[bound-identifier=?] (that is, one can bind the other) only if they have the same binding and if they have the same marks---counting only marks that were added after the binding. @@ -512,7 +512,7 @@ This marking process helps keep binding in an expanded program consistent with the lexical structure of the source program. For example, the expanded form of the program -@schemeblock[ +@racketblock[ (define x 12) (define-syntax m (syntax-rules () @@ -522,7 +522,7 @@ example, the expanded form of the program is -@schemeblock[ +@racketblock[ (define x 12) (define-syntax m (syntax-rules () @@ -530,42 +530,42 @@ is (let-values ([(x) 10]) x) ] -However, the result of the last expression is @scheme[12], not -@scheme[10]. The reason is that the transformer bound to @scheme[m] -introduces the binding @scheme[x], but the referencing @scheme[x] is -present in the argument to the transformer. The introduced @scheme[x] -is the one left with a mark, and the reference @scheme[x] has no mark, -so the binding @scheme[x] is not @scheme[bound-identifier=?] to the -body @scheme[x]. +However, the result of the last expression is @racket[12], not +@racket[10]. The reason is that the transformer bound to @racket[m] +introduces the binding @racket[x], but the referencing @racket[x] is +present in the argument to the transformer. The introduced @racket[x] +is the one left with a mark, and the reference @racket[x] has no mark, +so the binding @racket[x] is not @racket[bound-identifier=?] to the +body @racket[x]. -The @scheme[set!] form works with the @scheme[make-set!-transformer] -and @scheme[prop:set!-transformer] property to support -@deftech{assignment transformers} that transform @scheme[set!] +The @racket[set!] form works with the @racket[make-set!-transformer] +and @racket[prop:set!-transformer] property to support +@deftech{assignment transformers} that transform @racket[set!] expressions. An @tech{assignment transformer} contains a procedure -that is applied by @scheme[set!] in the same way as a normal +that is applied by @racket[set!] in the same way as a normal transformer by the expander. -The @scheme[make-rename-transformer] procedure or -@scheme[prop:rename-transformer] property creates a value that is also -handled specially by the expander and by @scheme[set!] as a -transformer binding's value. When @scheme[_id] is bound to a +The @racket[make-rename-transformer] procedure or +@racket[prop:rename-transformer] property creates a value that is also +handled specially by the expander and by @racket[set!] as a +transformer binding's value. When @racket[_id] is bound to a @deftech{rename transformer} produced by -@scheme[make-rename-transformer], it is replaced with the target -identifier passed to @scheme[make-rename-transformer]. In addition, as +@racket[make-rename-transformer], it is replaced with the target +identifier passed to @racket[make-rename-transformer]. In addition, as long as the target identifier does not have a true value for the -@scheme['not-free-identifier=?] @tech{syntax property}, the lexical information that -contains the binding of @scheme[_id] is also enriched so that -@scheme[_id] is @scheme[free-identifier=?] to the target identifier, -@scheme[identifier-binding] returns the same results for both -identifiers, and @scheme[provide] exports @scheme[_id] as the target +@racket['not-free-identifier=?] @tech{syntax property}, the lexical information that +contains the binding of @racket[_id] is also enriched so that +@racket[_id] is @racket[free-identifier=?] to the target identifier, +@racket[identifier-binding] returns the same results for both +identifiers, and @racket[provide] exports @racket[_id] as the target identifier. Finally, the binding is treated specially by -@scheme[syntax-local-value], and -@scheme[syntax-local-make-delta-introducer] as used by @tech{syntax +@racket[syntax-local-value], and +@racket[syntax-local-make-delta-introducer] as used by @tech{syntax transformer}s. In addition to using marks to track introduced identifiers, the expander tracks the expansion history of a form through @tech{syntax -properties} such as @scheme['origin]. See @secref["stxprops"] for +properties} such as @racket['origin]. See @secref["stxprops"] for more information. Finally, the expander uses @tech{syntax certificates} to control the @@ -573,15 +573,15 @@ way that unexported and protected @tech{module bindings} are used. See @secref["stxcerts"] for more information on @tech{syntax certificates}. -The expander's handling of @scheme[letrec-values+syntaxes] is similar -to its handling of @scheme[define-syntaxes]. A -@scheme[letrec-values+syntaxes] mist be expanded in an arbitrary phase +The expander's handling of @racket[letrec-values+syntaxes] is similar +to its handling of @racket[define-syntaxes]. A +@racket[letrec-values+syntaxes] mist be expanded in an arbitrary phase level @math{n} (not just 0), in which case the expression for the @tech{transformer binding} is expanded at @tech{phase level} @math{n+1}. -The expression in a @scheme[define-for-syntax] or -@scheme[define-values-for-syntax] form is expanded and evaluated in -the same way as for @scheme[syntax]. However, the introduced binding +The expression in a @racket[define-for-syntax] or +@racket[define-values-for-syntax] form is expanded and evaluated in +the same way as for @racket[syntax]. However, the introduced binding is a variable binding at @tech{phase level} 1 (not a @tech{transformer binding} at @tech{phase level} 0). @@ -595,9 +595,9 @@ forms. Partial expansion works by cutting off the normal recursion expansion when the relevant binding is for a primitive syntactic form. As a special case, when expansion would otherwise add an -@schemeidfont{#%app}, @schemeidfont{#%datum}, or @schemeidfont{#%top} +@racketidfont{#%app}, @racketidfont{#%datum}, or @racketidfont{#%top} identifier to an expression, and when the binding turns out to be the -primitive @scheme[#%app], @scheme[#%datum], or @scheme[#%top] form, +primitive @racket[#%app], @racket[#%datum], or @racket[#%top] form, then expansion stops without adding the identifier. @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -611,72 +611,72 @@ recursively expands only until the form becomes one of the following: @itemize[ - @item{A @scheme[define-values] or @scheme[define-syntaxes] form, for + @item{A @racket[define-values] or @racket[define-syntaxes] form, for any form other than the last one: The definition form is not expanded further. Instead, the next form is expanded partially, and so on. As soon as an expression form is found, the accumulated definition forms are converted to a - @scheme[letrec-values] (if no @scheme[define-syntaxes] forms - were found) or @scheme[letrec-syntaxes+values] form, moving the + @racket[letrec-values] (if no @racket[define-syntaxes] forms + were found) or @racket[letrec-syntaxes+values] form, moving the expression forms to the body to be expanded in expression context. - When a @scheme[define-values] form is discovered, the lexical + When a @racket[define-values] form is discovered, the lexical context of all syntax objects for the body sequence is immediately enriched with bindings for the - @scheme[define-values] form before expansion continues. When a - @scheme[define-syntaxes] form is discovered, the right-hand + @racket[define-values] form before expansion continues. When a + @racket[define-syntaxes] form is discovered, the right-hand side is expanded and evaluated (as for a - @scheme[letrec-values+syntaxes] form), and a transformer + @racket[letrec-values+syntaxes] form), and a transformer binding is installed for the body sequence before expansion continues.} - @item{A primitive expression form other than @scheme[begin]: The + @item{A primitive expression form other than @racket[begin]: The expression is expanded in an expression context, along with all remaining body forms. If any definitions were found, this expansion takes place after conversion to a - @scheme[letrec-values] or @scheme[letrec-syntaxes+values] + @racket[letrec-values] or @racket[letrec-syntaxes+values] form. Otherwise, the expressions are expanded immediately.} - @item{A @scheme[begin] form: The sub-forms of the @scheme[begin] are + @item{A @racket[begin] form: The sub-forms of the @racket[begin] are spliced into the internal-definition sequence, and partial expansion continues with the first of the newly-spliced forms - (or the next form, if the @scheme[begin] had no sub-forms).} + (or the next form, if the @racket[begin] had no sub-forms).} ] -If the last expression form turns out to be a @scheme[define-values] -or @scheme[define-syntaxes] form, expansion fails with a syntax error. +If the last expression form turns out to be a @racket[define-values] +or @racket[define-syntaxes] form, expansion fails with a syntax error. @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @subsection[#:tag "mod-parse"]{Module Phases and Visits} -A @scheme[require] form not only introduces @tech{bindings} at +A @racket[require] form not only introduces @tech{bindings} at expansion time, but also @deftech{visits} the referenced module when it is encountered by the expander. That is, the expander -instantiates any @scheme[define-for-syntax]ed variables defined +instantiates any @racket[define-for-syntax]ed variables defined in the module, and also evaluates all expressions for -@scheme[define-syntaxes] @tech{transformer bindings}. +@racket[define-syntaxes] @tech{transformer bindings}. -Module @tech{visits} propagate through @scheme[require]s in the same +Module @tech{visits} propagate through @racket[require]s in the same way as module @tech{instantiation}. Moreover, when a module is -@tech{visit}ed at @tech{phase} 0, any module that it @scheme[require]s -@scheme[for-syntax] is @tech{instantiate}d at @tech{phase} 1, while -further @scheme[require]s @scheme[for-template] leading back +@tech{visit}ed at @tech{phase} 0, any module that it @racket[require]s +@racket[for-syntax] is @tech{instantiate}d at @tech{phase} 1, while +further @racket[require]s @racket[for-template] leading back to @tech{phase} 0 causes the required module to be visited at @tech{phase} 0 (i.e., not @tech{instantiate}d). During compilation, the top-level of module context is itself implicitly @tech{visit}ed. Thus, when the expander encounters -@scheme[(require (for-syntax ....))], it immediately +@racket[(require (for-syntax ....))], it immediately @tech{instantiate}s the required module at @tech{phase} 1, in addition to adding bindings at @tech{phase level} 1 (i.e., the @tech{transformer environment}). Similarly, the expander immediately -evaluates any @scheme[define-values-for-syntax] form that it +evaluates any @racket[define-values-for-syntax] form that it encounters. @tech{Phases} beyond 0 are @tech{visit}ed on demand. For example, -when the right-hand side of a @tech{phase}-0 @scheme[let-syntax] is to +when the right-hand side of a @tech{phase}-0 @racket[let-syntax] is to be expanded, then modules that are @tech{available} at @tech{phase} 1 are visited. More generally, initiating expansion at @tech{phase} @math{n} @tech{visit}s modules at @tech{phase} @math{n}, which in turn @@ -686,14 +686,14 @@ modules in the enclosing @tech{namespace}'s @tech{module registry}; a per-registry lock prevents multiple threads from concurrently instantiating and visiting available modules. -When the expander encounters @scheme[require] and @scheme[(require +When the expander encounters @racket[require] and @racket[(require (for-syntax ....))] within a @tech{module context}, the resulting @tech{visits} and @tech{instantiations} are specific to the expansion of the enclosing module, and are kept separate from @tech{visits} and @tech{instantiations} triggered from a @tech{top-level context} or from the expansion of a different module. Along the same lines, when a module is attached to a namespace through -@scheme[namespace-attach-module], modules that it @scheme[require]s +@racket[namespace-attach-module], modules that it @racket[require]s are transitively attached, but instances are attached only at phases at or below the namespace's @tech{base phase}. @@ -710,7 +710,7 @@ When a top-level definition binds an identifier that originates from a (define-syntax def-and-use-of-x (syntax-rules () [(def-and-use-of-x val) - (code:comment @#,t{@scheme[x] below originates from this macro:}) + (code:comment @#,t{@racket[x] below originates from this macro:}) (begin (define x val) x)])) (define x 1) x @@ -720,7 +720,7 @@ x (define-syntax def-and-use (syntax-rules () [(def-and-use x val) - (code:comment @#,t{@scheme{x} below was provided by the macro use:}) + (code:comment @#,t{@racket{x} below was provided by the macro use:}) (begin (define x val) x)])) (def-and-use x 3) x @@ -733,12 +733,12 @@ For a top-level definition (outside of a module), the order of definition were not present. (No such dependency on order occurs within a module, since a module binding covers the entire module body.) To support the declaration of an identifier before its use, - the @scheme[define-syntaxes] form avoids binding an identifier if the - body of the @scheme[define-syntaxes] declaration produces zero + the @racket[define-syntaxes] form avoids binding an identifier if the + body of the @racket[define-syntaxes] declaration produces zero results. @examples[ -#:eval scheme-eval +#:eval racket-eval (define bucket-1 0) (define bucket-2 0) (define-syntax def-and-set!-use-of-x @@ -755,7 +755,7 @@ bucket-2 (syntax-rules () [(def-and-use) (begin - (code:comment @#,t{Initial reference to @scheme[even] precedes definition:}) + (code:comment @#,t{Initial reference to @racket[even] precedes definition:}) (define (odd x) (if (zero? x) #f (even (sub1 x)))) (define (even x) (if (zero? x) #t (odd (sub1 x)))) (odd 17))])) @@ -765,7 +765,7 @@ bucket-2 (syntax-rules () [(def-and-use) (begin - (code:comment @#,t{Declare before definition via no-values @scheme[define-syntaxes]:}) + (code:comment @#,t{Declare before definition via no-values @racket[define-syntaxes]:}) (define-syntaxes (odd even) (values)) (define (odd x) (if (zero? x) #f (even (sub1 x)))) (define (even x) (if (zero? x) #t (odd (sub1 x)))) @@ -773,29 +773,29 @@ bucket-2 (defs-and-uses) ] -Macro-generated @scheme{require} and @scheme{provide} +Macro-generated @racket{require} and @racket{provide} clauses also introduce and reference generation-specific bindings: @itemize[ - @item{In @scheme[require], for a @scheme[_require-spec] of the form - @scheme[(rename-in [_orig-id _bind-id])] or @scheme[(only-in - .... [_orig-id _bind-id])], the @scheme[_bind-id] is bound only for + @item{In @racket[require], for a @racket[_require-spec] of the form + @racket[(rename-in [_orig-id _bind-id])] or @racket[(only-in + .... [_orig-id _bind-id])], the @racket[_bind-id] is bound only for uses of the identifier generated by the same macro expansion as - @scheme[_bind-id]. In @scheme[require] for other - @scheme[_require-spec]s, the generator of the @scheme[_require-spec] + @racket[_bind-id]. In @racket[require] for other + @racket[_require-spec]s, the generator of the @racket[_require-spec] determines the scope of the bindings.} - @item{In @scheme[provide], for a @scheme[_provide-spec] of the form - @scheme[_id], the exported identifier is the one that binds - @scheme[_id] within the module in a generator-specific way, but the - external name is the plain @scheme[_id]. The exceptions for - @scheme[all-except-out] are similarly determined in a - generator-specific way, as is the @scheme[_orig-id] binding of a - @scheme[rename-out] form, but plain identifiers are used for the - external names. For @scheme[all-defined-out], only identifiers with + @item{In @racket[provide], for a @racket[_provide-spec] of the form + @racket[_id], the exported identifier is the one that binds + @racket[_id] within the module in a generator-specific way, but the + external name is the plain @racket[_id]. The exceptions for + @racket[all-except-out] are similarly determined in a + generator-specific way, as is the @racket[_orig-id] binding of a + @racket[rename-out] form, but plain identifiers are used for the + external names. For @racket[all-defined-out], only identifiers with definitions having the same generator as the - @scheme[(all-defined-out)] form are exported; the external name is + @racket[(all-defined-out)] form are exported; the external name is the plain identifier from the definition.} ] @@ -815,7 +815,7 @@ string, so it is suitable for saving and re-loading code. Although individual read, expand, compile, and evaluate operations are available, the operations are often combined automatically. For -example, the @scheme[eval] procedure takes a syntax object and expands +example, the @racket[eval] procedure takes a syntax object and expands it, compiles it, and evaluates it. @;------------------------------------------------------------------------ @@ -826,7 +826,7 @@ manipulate namespaces.} A @deftech{namespace} is a top-level mapping from symbols to binding information. It is the starting point for expanding an expression; a -@tech{syntax object} produced by @scheme[read-syntax] has no initial +@tech{syntax object} produced by @racket[read-syntax] has no initial lexical context; the @tech{syntax object} can be expanded after initializing it with the mappings of a particular namespace. A namespace is also the starting point evaluating expanded code, where @@ -850,7 +850,7 @@ An ``empty'' namespace maps all symbols to top-level variables. Certain evaluations extend a namespace for future expansions; importing a module into the top-level adjusts the namespace bindings for all of the imported named, and evaluating a top-level -@scheme[define] form updates the namespace's mapping to refer to a +@racket[define] form updates the namespace's mapping to refer to a variable (in addition to installing a value into the variable). A namespace also has a @deftech{module registry} that maps module @@ -863,9 +863,9 @@ distinct set of module instances in each @tech{phase}. That is, even though module declarations are shared for all @tech{phase levels}, module instances are distinct for each @tech{phase}. Each namespace has a @deftech{base phase}, which corresponds to the phase used by -reflective operations such as @scheme[eval] and -@scheme[dynamic-require]. In particular, using @scheme[eval] on a -@scheme[require] form @tech{instantiates} a module in the namespace's +reflective operations such as @racket[eval] and +@racket[dynamic-require]. In particular, using @racket[eval] on a +@racket[require] form @tech{instantiates} a module in the namespace's @tech{base phase}. After a namespace is created, module instances from existing @@ -890,14 +890,14 @@ and to start evaluating expanded/compiled code. @examples[ (code:line (define x 'orig) (code:comment @#,t{define in the original namespace})) -(code:comment @#,t{The following @scheme[let] expression is compiled in the original}) -(code:comment @#,t{namespace, so direct references to @scheme[x] see @scheme['orig].}) +(code:comment @#,t{The following @racket[let] expression is compiled in the original}) +(code:comment @#,t{namespace, so direct references to @racket[x] see @racket['orig].}) (code:line (let ([n (make-base-namespace)]) (code:comment @#,t{make new namespace}) (parameterize ([current-namespace n]) (eval '(define x 'new)) (code:comment @#,t{evals in the new namespace}) - (display x) (code:comment @#,t{displays @scheme['orig]}) - (display (eval 'x)))) (code:comment @#,t{displays @scheme['new]})) + (display x) (code:comment @#,t{displays @racket['orig]}) + (display (eval 'x)))) (code:comment @#,t{displays @racket['new]})) ] A @tech{namespace} is purely a top-level entity, not to be confused @@ -924,7 +924,7 @@ x (define x 7) x (f) -(module m mzscheme (define x 8) (provide x)) +(module m racket (define x 8) (provide x)) (require 'm) (eval:alts x (eval 'x)) (f) @@ -937,28 +937,28 @@ To improve error reporting, names are inferred at compile-time for certain kinds of values, such as procedures. For example, evaluating the following expression: -@schemeblock[ +@racketblock[ (let ([f (lambda () 0)]) (f 1 2 3)) ] produces an error message because too many arguments are provided to -the procedure. The error message is able to report @schemeidfont{f} as -the name of the procedure. In this case, Scheme decides, at -compile-time, to name as @scheme['f] all procedures created by the -@scheme[let]-bound @scheme[lambda]. +the procedure. The error message is able to report @racketidfont{f} as +the name of the procedure. In this case, Racket decides, at +compile-time, to name as @racket['f] all procedures created by the +@racket[let]-bound @racket[lambda]. Names are inferred whenever possible for procedures. Names closer to an expression take precedence. For example, in -@schemeblock[ +@racketblock[ (define my-f (let ([f (lambda () 0)]) f)) ] -the procedure bound to @scheme[my-f] will have the inferred name -@scheme['f]. +the procedure bound to @racket[my-f] will have the inferred name +@racket['f]. -When an @indexed-scheme['inferred-name] property is attached to a +When an @indexed-racket['inferred-name] property is attached to a syntax object for an expression (see @secref["stxprops"]), the property value is used for naming the expression, and it overrides any name that was inferred from the expression's context. Normally, the @@ -967,8 +967,8 @@ property value should be a symbol or an identifier. When an inferred name is not available, but a source location is available, a name is constructed using the source location information. Inferred and property-assigned names are also available -to syntax transformers, via @scheme[syntax-local-name]. +to syntax transformers, via @racket[syntax-local-name]. @;---------------------------------------- -@close-eval[scheme-eval] +@close-eval[racket-eval] diff --git a/collects/scribblings/reference/syntax.scrbl b/collects/scribblings/reference/syntax.scrbl index a9b7326484..436b071eb1 100644 --- a/collects/scribblings/reference/syntax.scrbl +++ b/collects/scribblings/reference/syntax.scrbl @@ -22,9 +22,9 @@ the-eval))) @(define meta-in-eval (syntax-eval)) -@(define cvt (schemefont "CVT")) -@(define unquote-id (scheme unquote)) -@(define unquote-splicing-id (scheme unquote-splicing)) +@(define cvt (racketfont "CVT")) +@(define unquote-id (racket unquote)) +@(define unquote-splicing-id (racket unquote-splicing)) @title[#:tag "syntax" #:style 'toc]{Syntactic Forms} @@ -39,20 +39,20 @@ See @secref["fully-expanded"] for the core grammar. Each syntactic form is described by a BNF-like notation that describes a combination of (syntax-wrapped) pairs, symbols, and other data (not a sequence of characters). These grammatical specifications are shown -as in the following specification of a @schemekeywordfont{something} +as in the following specification of a @racketkeywordfont{something} form: -@specsubform[(@#,schemekeywordfont{something} id thing-expr ...) +@specsubform[(@#,racketkeywordfont{something} id thing-expr ...) #:contracts ([thing-expr number?])] Within such specifications, @itemize[ - @item{@scheme[...] indicates zero or more + @item{@racket[...] indicates zero or more repetitions of the preceding datum.} - @item{@scheme[...+] indicates one or + @item{@racket[...+] indicates one or more repetitions of the preceding datum.} @item{Italic meta-identifiers play the role of non-terminals. Some @@ -60,17 +60,17 @@ Within such specifications, @itemize[ - @item{A meta-identifier that ends in @scheme[_id] stands for an + @item{A meta-identifier that ends in @racket[_id] stands for an identifier.} - @item{A meta-identifier that ends in @scheme[_keyword] stands + @item{A meta-identifier that ends in @racket[_keyword] stands for a keyword.} - @item{A meta-identifier that ends with @scheme[_expr] (such as - @scheme[_thing-expr]) stands for a sub-form that is + @item{A meta-identifier that ends with @racket[_expr] (such as + @racket[_thing-expr]) stands for a sub-form that is expanded as an expression.} - @item{A meta-identifier that ends with @scheme[_body] stands + @item{A meta-identifier that ends with @racket[_body] stands for a sub-form that is expanded in an internal-definition context (see @secref["intdef-body"]).} @@ -78,75 +78,75 @@ Within such specifications, ]} @item{Contracts indicate constraints on sub-expression results. For - example, @scheme[_thing-expr @#,elem{:} number?] indicates that - the expression @scheme[_thing-expr] must produce a number.}] + example, @racket[_thing-expr @#,elem{:} number?] indicates that + the expression @racket[_thing-expr] must produce a number.}] @;------------------------------------------------------------------------ -@section[#:tag "module"]{Modules: @scheme[module], ...} +@section[#:tag "module"]{Modules: @racket[module], ...} -@guideintro["module-syntax"]{@scheme[module]} +@guideintro["module-syntax"]{@racket[module]} @defform[(module id module-path form ...)]{ Declares a top-level module. If the -@scheme[current-module-declare-name] parameter is set, the parameter -value is used for the module name, otherwise @scheme[(#,(scheme quote) +@racket[current-module-declare-name] parameter is set, the parameter +value is used for the module name, otherwise @racket[(#,(racket quote) id)] is the name of the declared module. -@margin-note/ref{For a @scheme[module]-like form for use @emph{within} -modules and other contexts, see @scheme[define-package].} +@margin-note/ref{For a @racket[module]-like form for use @emph{within} +modules and other contexts, see @racket[define-package].} -The @scheme[module-path] form must be as for @scheme[require], and it -supplies the initial bindings for the body @scheme[form]s. That is, it -is treated like a @scheme[(require module-path)] prefix before the -@scheme[form]s, except that the bindings introduced by -@scheme[module-path] can be shadowed by definitions and -@scheme[require]s in the module body @scheme[form]s. +The @racket[module-path] form must be as for @racket[require], and it +supplies the initial bindings for the body @racket[form]s. That is, it +is treated like a @racket[(require module-path)] prefix before the +@racket[form]s, except that the bindings introduced by +@racket[module-path] can be shadowed by definitions and +@racket[require]s in the module body @racket[form]s. -If a single @scheme[form] is provided, then it is partially expanded +If a single @racket[form] is provided, then it is partially expanded in a @tech{module-begin context}. If the expansion leads to -@scheme[#%plain-module-begin], then the body of the -@scheme[#%plain-module-begin] is the body of the module. If partial +@racket[#%plain-module-begin], then the body of the +@racket[#%plain-module-begin] is the body of the module. If partial expansion leads to any other primitive form, then the form is wrapped -with @schemeidfont{#%module-begin} using the lexical context of the +with @racketidfont{#%module-begin} using the lexical context of the module body; this identifier must be bound by the initial -@scheme[module-path] import, and its expansion must produce a -@scheme[#%plain-module-begin] to supply the module body. Finally, if -multiple @scheme[form]s are provided, they are wrapped with -@schemeidfont{#%module-begin}, as in the case where a single -@scheme[form] does not expand to @scheme[#%plain-module-begin]. +@racket[module-path] import, and its expansion must produce a +@racket[#%plain-module-begin] to supply the module body. Finally, if +multiple @racket[form]s are provided, they are wrapped with +@racketidfont{#%module-begin}, as in the case where a single +@racket[form] does not expand to @racket[#%plain-module-begin]. After such wrapping, if any, and before any expansion, an -@indexed-scheme['enclosing-module-name] property is attached to the -@schemeidfont{#%module-begin} syntax object (see +@indexed-racket['enclosing-module-name] property is attached to the +@racketidfont{#%module-begin} syntax object (see @secref["stxprops"]); the property's value is a symbol -corresponding to @scheme[id]. +corresponding to @racket[id]. -Each @scheme[form] is partially expanded (see +Each @racket[form] is partially expanded (see @secref["partial-expansion"]) in a @tech{module context}. Further action depends on the shape of the form: @itemize[ - @item{If it is a @scheme[begin] form, the sub-forms are flattened + @item{If it is a @racket[begin] form, the sub-forms are flattened out into the module's body and immediately processed in place of the - @scheme[begin].} + @racket[begin].} - @item{If it is a @scheme[define-syntaxes] or - @scheme[define-values-for-syntax] form, then the right-hand side is + @item{If it is a @racket[define-syntaxes] or + @racket[define-values-for-syntax] form, then the right-hand side is evaluated (in @tech{phase} 1), and the binding is immediately installed for further partial expansion within the - module. Evaluation of the right-hand side is @scheme[parameterize]d - to set @scheme[current-namespace] as in @scheme[let-syntax].} + module. Evaluation of the right-hand side is @racket[parameterize]d + to set @racket[current-namespace] as in @racket[let-syntax].} - @item{If the form is a @scheme[require] form, bindings are introduced + @item{If the form is a @racket[require] form, bindings are introduced immediately, and the imported modules are @tech{instantiate}d or @tech{visit}ed as appropriate.} - @item{If the form is a @scheme[provide] form, then it is recorded for + @item{If the form is a @racket[provide] form, then it is recorded for processing after the rest of the body.} - @item{If the form is a @scheme[define-values] form, then the binding + @item{If the form is a @racket[define-values] form, then the binding is installed immediately, but the right-hand expression is not expanded further.} @@ -155,55 +155,55 @@ action depends on the shape of the form: ] -After all @scheme[form]s have been partially expanded this way, then +After all @racket[form]s have been partially expanded this way, then the remaining expression forms (including those on the right-hand side of a definition) are expanded in an expression context. The scope of all imported identifiers covers the entire module body, as does the scope of any identifier defined within the module body. The ordering of syntax definitions does not affect the scope of the -syntax names; a transformer for @scheme[A] can produce expressions -containing @scheme[B], while the transformer for @scheme[B] produces -expressions containing @scheme[A], regardless of the order of -declarations for @scheme[A] and @scheme[B]. However, a syntactic form +syntax names; a transformer for @racket[A] can produce expressions +containing @racket[B], while the transformer for @racket[B] produces +expressions containing @racket[A], regardless of the order of +declarations for @racket[A] and @racket[B]. However, a syntactic form that produces syntax definitions must be defined before it is used. No identifier can be imported or defined more than once at any @tech{phase level}. Every exported identifier must be imported or defined. No expression can refer to a @tech{top-level variable}. -The evaluation of a @scheme[module] form does not evaluate the +The evaluation of a @racket[module] form does not evaluate the expressions in the body of the module. Evaluation merely declares a -module, whose full name depends both on @scheme[id] and -@scheme[(current-module-declare-name)]. +module, whose full name depends both on @racket[id] and +@racket[(current-module-declare-name)]. The module body is executed only when the module is explicitly -@techlink{instantiate}d via @scheme[require] or -@scheme[dynamic-require]. On invocation, expressions and definitions +@techlink{instantiate}d via @racket[require] or +@racket[dynamic-require]. On invocation, expressions and definitions are evaluated in order as they appear within the module. Each evaluation of an expression or definition is wrapped with a -continuation prompt (see @scheme[call-with-continuation-prompt]) for +continuation prompt (see @racket[call-with-continuation-prompt]) for the default continuation and using the default prompt handler. Accessing a @tech{module-level variable} before it is defined signals a run-time error, just like accessing an undefined global variable. If a module (in its fully expanded form) does not contain a -@scheme[set!] for an identifier that defined within the module, then +@racket[set!] for an identifier that defined within the module, then the identifier is a @defterm{constant} after it is defined; its value cannot be changed afterward, not even through reflective -mechanisms. The @scheme[compile-enforce-module-constants] parameter, +mechanisms. The @racket[compile-enforce-module-constants] parameter, however, can be used to disable enforcement of constants. -When a @tech{syntax object} representing a @scheme[module] form has a -@indexed-scheme['module-language] @tech{syntax property} attached, and +When a @tech{syntax object} representing a @racket[module] form has a +@indexed-racket['module-language] @tech{syntax property} attached, and when the property value is a vector of three elements where the first -is a module path (in the sense of @scheme[module-path?]) and the +is a module path (in the sense of @racket[module-path?]) and the second is a symbol, then the property value is preserved in the corresponding compiled and/or declared module. The third component of -the vector should be printable and @scheme[read]able, so that it can +the vector should be printable and @racket[read]able, so that it can be preserved in marshaled bytecode. See also -@scheme[module-compiled-language-info] and -@scheme[module->language-info].} +@racket[module-compiled-language-info] and +@racket[module->language-info].} See also @secref["module-eval-model"] and @secref["mod-parse"]. @@ -220,24 +220,24 @@ See also @secref["module-eval-model"] and @secref["mod-parse"]. @defform[(#%module-begin form ...)]{ Legal only in a @tech{module begin context}, and handled by the -@scheme[module] form. +@racket[module] form. -The @scheme[#%module-begin] form of @schememodname[racket/base] wraps +The @racket[#%module-begin] form of @racketmodname[racket/base] wraps every top-level expression to print non-@|void-const| results using -@scheme[current-print].} +@racket[current-print].} @defform[(#%plain-module-begin form ...)]{ Legal only in a @tech{module begin context}, and handled by the -@scheme[module] form.} +@racket[module] form.} @;------------------------------------------------------------------------ -@section[#:tag '("require" "provide")]{Importing and Exporting: @scheme[require] and @scheme[provide]} +@section[#:tag '("require" "provide")]{Importing and Exporting: @racket[require] and @racket[provide]} @section-index["modules" "imports"] @section-index["modules" "exports"] -@guideintro["module-require"]{@scheme[require]} +@guideintro["module-require"]{@racket[require]} @defform/subs[#:literals (only-in prefix-in except-in rename-in lib file planet + - = for-syntax for-template for-label for-meta only-meta-in combine-in quote) @@ -254,7 +254,7 @@ Legal only in a @tech{module begin context}, and handled by the (for-label require-spec ...) (for-meta phase-level require-spec ...) derived-require-spec] - [module-path (#,(scheme quote) id) + [module-path (#,(racket quote) id) rel-string (lib rel-string ...+) id @@ -272,60 +272,60 @@ Legal only in a @tech{module begin context}, and handled by the (code:line nat minor-vers)] [minor-vers nat (nat nat) - ((unsyntax (schemeidfont "=")) nat) - ((unsyntax (schemeidfont "+")) nat) - ((unsyntax (schemeidfont "-")) nat)])]{ + ((unsyntax (racketidfont "=")) nat) + ((unsyntax (racketidfont "+")) nat) + ((unsyntax (racketidfont "-")) nat)])]{ -In a @tech{top-level context}, @scheme[require] @tech{instantiates} +In a @tech{top-level context}, @racket[require] @tech{instantiates} modules (see @secref["module-eval-model"]). In a @tech{top-level -context} or @tech{module context}, expansion of @scheme[require] +context} or @tech{module context}, expansion of @racket[require] @tech{visits} modules (see @secref["mod-parse"]). In both contexts and -both evaluation and expansion, @scheme[require] introduces bindings +both evaluation and expansion, @racket[require] introduces bindings into a @tech{namespace} or a module (see @secref["intro-binding"]). A -@scheme[require] form in a @tech{expression context} or +@racket[require] form in a @tech{expression context} or @tech{internal-definition context} is a syntax error. -A @scheme[require-spec] designates a particular set of identifiers to +A @racket[require-spec] designates a particular set of identifiers to be bound in the importing context. Each identifier is mapped to a particular export of a particular module; the identifier to bind may be different from the symbolic name of the originally exported identifier. Each identifier also binds at a particular @tech{phase level}. -The syntax of @scheme[require-spec] can be extended via -@scheme[define-require-syntax], and when multiple -@scheme[require-spec]s are specified in a @scheme[require], the -bindings of each @scheme[require-spec] are visible for expanding later -@scheme[require-spec]s. The pre-defined forms (as exported by -@scheme[racket/base]) are as follows: +The syntax of @racket[require-spec] can be extended via +@racket[define-require-syntax], and when multiple +@racket[require-spec]s are specified in a @racket[require], the +bindings of each @racket[require-spec] are visible for expanding later +@racket[require-spec]s. The pre-defined forms (as exported by +@racketmodname[racket/base]) are as follows: @specsubform[module-path]{ Imports all exported bindings from the named module, using the export identifiers as the local identifiers. - (See below for information on @scheme[module-path].) The lexical - context of the @scheme[module-path] form determines the context of + (See below for information on @racket[module-path].) The lexical + context of the @racket[module-path] form determines the context of the introduced identifiers.} @defsubform[(only-in require-spec id-maybe-renamed ...)]{ - Like @scheme[require-spec], but constrained to those exports for - which the identifiers to bind match @scheme[id-maybe-renamed]: as - @scheme[_id] or as @scheme[_orig-id] in @scheme[[_orig-id _bind-id]]. If - the @scheme[_id] or @scheme[_orig-id] of any @scheme[id-maybe-renamed] - is not in the set that @scheme[require-spec] describes, a syntax + Like @racket[require-spec], but constrained to those exports for + which the identifiers to bind match @racket[id-maybe-renamed]: as + @racket[_id] or as @racket[_orig-id] in @racket[[_orig-id _bind-id]]. If + the @racket[_id] or @racket[_orig-id] of any @racket[id-maybe-renamed] + is not in the set that @racket[require-spec] describes, a syntax error is reported. @defexamples[#:eval (syntax-eval) (require (only-in racket/tcp tcp-listen - (tcp-accept my-accept))) + [tcp-accept my-accept])) tcp-listen my-accept tcp-accept ]} @defsubform[(except-in require-spec id ...)]{ Like - @scheme[require-spec], but omitting those imports for which - @scheme[id]s are the identifiers to bind; if any @scheme[id] is not - in the set that @scheme[require-spec] describes, a syntax error is + @racket[require-spec], but omitting those imports for which + @racket[id]s are the identifiers to bind; if any @racket[id] is not + in the set that @racket[require-spec] describes, a syntax error is reported. @defexamples[#:eval (syntax-eval) @@ -336,9 +336,9 @@ bindings of each @scheme[require-spec] are visible for expanding later ]} @defsubform[(prefix-in prefix-id require-spec)]{ Like - @scheme[require-spec], but adjusting each identifier to be bound by - prefixing it with @scheme[prefix-id]. The lexical context of the - @scheme[prefix-id] is ignored, and instead preserved from the + @racket[require-spec], but adjusting each identifier to be bound by + prefixing it with @racket[prefix-id]. The lexical context of the + @racket[prefix-id] is ignored, and instead preserved from the identifiers before prefixing. @defexamples[#:eval (syntax-eval) @@ -348,9 +348,9 @@ bindings of each @scheme[require-spec] are visible for expanding later ]} @defsubform[(rename-in require-spec [orig-id bind-id] ...)]{ - Like @scheme[require-spec], but replacing the identifier to - bind @scheme[orig-id] with @scheme[bind-id]; if any - @scheme[orig-id] is not in the set that @scheme[require-spec] + Like @racket[require-spec], but replacing the identifier to + bind @racket[orig-id] with @racket[bind-id]; if any + @racket[orig-id] is not in the set that @racket[require-spec] describes, a syntax error is reported. @defexamples[#:eval (syntax-eval) @@ -362,7 +362,7 @@ bindings of each @scheme[require-spec] are visible for expanding later ]} @defsubform[(combine-in require-spec ...)]{ - The union of the @scheme[require-spec]s. + The union of the @racket[require-spec]s. @defexamples[#:eval (syntax-eval) (require (combine-in (only-in racket/tcp tcp-accept) @@ -372,15 +372,15 @@ bindings of each @scheme[require-spec] are visible for expanding later ]} @defsubform[(only-meta-in phase-level require-spec ...)]{ - Like the combination of @scheme[require-spec]s, but removing any - binding that is not for @scheme[phase-level], where @scheme[#f] for - @scheme[phase-level] corresponds to the @tech{label phase level}. + Like the combination of @racket[require-spec]s, but removing any + binding that is not for @racket[phase-level], where @racket[#f] for + @racket[phase-level] corresponds to the @tech{label phase level}. The following example imports bindings only at @tech{phase level} 1, the transform phase: @interaction[#:eval meta-in-eval - (module nest scheme + (module nest racket (provide (for-syntax meta-eggs) (for-meta 1 meta-chicks) num-eggs) @@ -408,13 +408,13 @@ bindings of each @scheme[require-spec] are visible for expanding later @specsubform[#:literals (for-meta) (for-meta phase-level require-spec ...)]{Like the combination of - @scheme[require-spec]s, but constrained each binding specified by - each @scheme[require-spec] is shifted by @scheme[phase-level]. The - @tech{label phase level} corresponds to @scheme[#f], and a shifting - combination that involves @scheme[#f] produces @scheme[#f]. + @racket[require-spec]s, but constrained each binding specified by + each @racket[require-spec] is shifted by @racket[phase-level]. The + @tech{label phase level} corresponds to @racket[#f], and a shifting + combination that involves @racket[#f] produces @racket[#f]. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide num-eggs) (define num-eggs 2)) (require (for-meta 0 'nest)) @@ -427,43 +427,43 @@ bindings of each @scheme[require-spec] are visible for expanding later @specsubform[#:literals (for-syntax) (for-syntax require-spec ...)]{Same as - @scheme[(for-meta 1 require-spec ...)].} + @racket[(for-meta 1 require-spec ...)].} @specsubform[#:literals (for-template) (for-template require-spec ...)]{Same as - @scheme[(for-meta -1 require-spec ...)].} + @racket[(for-meta -1 require-spec ...)].} @specsubform[#:literals (for-label) (for-label require-spec ...)]{Same as - @scheme[(for-meta #f require-spec ...)].} + @racket[(for-meta #f require-spec ...)].} - @specsubform[derived-require-spec]{See @scheme[define-require-syntax] - for information on expanding the set of @scheme[require-spec] + @specsubform[derived-require-spec]{See @racket[define-require-syntax] + for information on expanding the set of @racket[require-spec] forms.} @guideintro["module-paths"]{module paths} -A @scheme[module-path] identifies a module, either through a concrete +A @racket[module-path] identifies a module, either through a concrete name in the form of an identifier, or through an indirect name that can trigger automatic loading of the module declaration. Except for -the @scheme[id] case below, the actual resolution is up to the current +the @racket[id] case below, the actual resolution is up to the current @tech{module name resolver} (see -@scheme[current-module-name-resolver]), and the description below +@racket[current-module-name-resolver]), and the description below corresponds to the default @tech{module name resolver}. @specsubform[#:literals (quote) - (#,(scheme quote) id)]{ + (#,(racket quote) id)]{ Refers to a module previously declared interactively with the name - @scheme[id]. + @racket[id]. @examples[ - (code:comment @#,t{a module declared interactively as @schemeidfont{test}:}) - (eval:alts (require '@#,schemeidfont{test}) (void))]} + (code:comment @#,t{a module declared interactively as @racketidfont{test}:}) + (eval:alts (require '@#,racketidfont{test}) (void))]} @specsubform[rel-string]{A path relative to the containing source (as - determined by @scheme[current-load-relative-directory] or - @scheme[current-directory]). Regardless of the current platform, - @scheme[rel-string] is always parsed as a Unix-format relative path: + determined by @racket[current-load-relative-directory] or + @racket[current-directory]). Regardless of the current platform, + @racket[rel-string] is always parsed as a Unix-format relative path: @litchar{/} is the path delimiter (multiple adjacent @litchar{/}s are treated as a single delimiter), @litchar{..} accesses the parent directory, and @litchar{.} accesses the current directory. The path @@ -482,7 +482,7 @@ corresponds to the default @tech{module name resolver}. UTF-8 encoding). Such encodings are not decoded to arrive at a filename, but instead preserved in the file access.} - If @scheme[rel-string] ends with a @filepath{.ss} suffix, it is + If @racket[rel-string] ends with a @filepath{.ss} suffix, it is converted to a @filepath{.rkt} suffix. The @tech{compiled-load handler} may reverse that conversion if a @filepath{.rkt} file does not exist and a @filepath{.ss} exists. @@ -496,28 +496,28 @@ corresponds to the default @tech{module name resolver}. (eval:alts (require "../x.rkt") (void))]} @defsubform[(lib rel-string ...+)]{A path to a module installed into - a @tech{collection} (see @secref["collects"]). The @scheme[rel-string]s in - @scheme[lib] are constrained similar to the plain @scheme[rel-string] - case, with the additional constraint that a @scheme[rel-string] + a @tech{collection} (see @secref["collects"]). The @racket[rel-string]s in + @racket[lib] are constrained similar to the plain @racket[rel-string] + case, with the additional constraint that a @racket[rel-string] cannot contain @litchar{.} or @litchar{..} directory indicators. The specific interpretation of the path depends on the number and - shape of the @scheme[rel-string]s: + shape of the @racket[rel-string]s: @itemize[ - @item{If a single @scheme[rel-string] is provided, and if it + @item{If a single @racket[rel-string] is provided, and if it consists of a single element (i.e., no @litchar{/}) with no file - suffix (i.e., no @litchar{.}), then @scheme[rel-string] names a + suffix (i.e., no @litchar{.}), then @racket[rel-string] names a @tech{collection}, and @filepath{main.rkt} is the library file name. @examples[ - (code:comment @#,t{the main @schememodname[swindle] library:}) + (code:comment @#,t{the main @racketmodname[swindle] library:}) (eval:alts (require (lib "swindle")) (void)) (code:comment @#,t{the same:}) (eval:alts (require (lib "swindle/main.rkt")) (void))]} - @item{If a single @scheme[rel-string] is provided, and if it + @item{If a single @racket[rel-string] is provided, and if it consists of multiple @litchar{/}-separated elements, then each element up to the last names a @tech{collection}, subcollection, etc., and the last element names a file. If the last element has @@ -532,42 +532,42 @@ corresponds to the default @tech{module name resolver}. (code:comment @#,t{the same:}) (eval:alts (require (lib "swindle/turbo.ss")) (void))]} - @item{If a single @scheme[rel-string] is provided, and if it + @item{If a single @racket[rel-string] is provided, and if it consists of a single element @italic{with} a file suffix (i.e, - with a @litchar{.}), then @scheme[rel-string] names a file within + with a @litchar{.}), then @racket[rel-string] names a file within the @filepath{mzlib} @tech{collection}. A @filepath{.ss} suffix is converted to @filepath{.rkt}. (This convention is for - compatibility with older version of PLT Scheme.) + compatibility with older version of PLT Racket.) @examples[ (code:comment @#,t{@filepath{tar.rkt} module from the @filepath{mzlib} collection:}) (eval:alts (require (lib "tar.ss")) (void))]} - @item{Otherwise, when multiple @scheme[rel-string]s are provided, - the first @scheme[rel-string] is effectively moved after the - others, and all @scheme[rel-string]s are appended with @litchar{/} + @item{Otherwise, when multiple @racket[rel-string]s are provided, + the first @racket[rel-string] is effectively moved after the + others, and all @racket[rel-string]s are appended with @litchar{/} separators. The resulting path names a @tech{collection}, then subcollection, etc., ending with a file name. No suffix is added automatically, but a @filepath{.ss} suffix is converted to @filepath{.rkt}. (This convention is for compatibility with older - version of PLT Scheme.) + version of PLT Racket.) @examples[ (code:comment @#,t{@filepath{tar.rkt} module from the @filepath{mzlib} collection:}) (eval:alts (require (lib "tar.ss" "mzlib")) (void))]} ]} - @specsubform[id]{A shorthand for a @scheme[lib] form with a single - @scheme[_rel-string] whose characters are the same as in the symbolic - form of @scheme[id]. In addition to the constraints of a @scheme[lib] - @scheme[_rel-string], @scheme[id] must not contain @litchar{.}. + @specsubform[id]{A shorthand for a @racket[lib] form with a single + @racket[_rel-string] whose characters are the same as in the symbolic + form of @racket[id]. In addition to the constraints of a @racket[lib] + @racket[_rel-string], @racket[id] must not contain @litchar{.}. @examples[#:eval require-eval (eval:alts (require racket/tcp) (void))]} - @defsubform[(file string)]{Similar to the plain @scheme[rel-string] - case, but @scheme[string] is a path---possibly absolute---using the - current platform's path conventions and @scheme[expand-user-path]. + @defsubform[(file string)]{Similar to the plain @racket[rel-string] + case, but @racket[string] is a path---possibly absolute---using the + current platform's path conventions and @racket[expand-user-path]. A @filepath{.ss} suffix is converted to @filepath{.rkt}. @examples[(eval:alts (require (file "~/tmp/x.rkt")) (void))]} @@ -579,7 +579,7 @@ corresponds to the default @tech{module name resolver}. Specifies a library available via the @PLaneT server. - The first form is a shorthand for the last one, where the @scheme[id]'s + The first form is a shorthand for the last one, where the @racket[id]'s character sequence must match the following @nonterm{spec} grammar: @BNF[ @@ -610,24 +610,24 @@ corresponds to the default @tech{module name resolver}. @nonterm{path}; if no @nonterm{path} is included, @filepath{main.rkt} is used in the expansion. - A @scheme[(planet string)] form is like a @scheme[(planet id)] form + A @racket[(planet string)] form is like a @racket[(planet id)] form with the identifier converted to a string, except that the - @scheme[string] can optionally end with a file extension (i.e., a + @racket[string] can optionally end with a file extension (i.e., a @litchar{.}) for a @nonterm{path}. A @filepath{.ss} file extension is converted to @filepath{.rkt}. - In the more general last form of a @scheme[planet] module path, the - @scheme[rel-string]s are similar to the @scheme[lib] form, except - that the @scheme[(user-string pkg-string vers)] names a + In the more general last form of a @racket[planet] module path, the + @racket[rel-string]s are similar to the @racket[lib] form, except + that the @racket[(user-string pkg-string vers)] names a @|PLaneT|-based package instead of a @tech{collection}. A version specification can include an optional major and minor version, where the minor version can be a specific number or a constraint: - @scheme[(_nat _nat)] specifies an inclusive range, @scheme[((unsyntax - (schemeidfont "=")) _nat)] specifies an exact match, - @scheme[((unsyntax (schemeidfont "+")) _nat)] specifies a minimum - version and is equivalent to just @scheme[_nat], and - @scheme[((unsyntax (schemeidfont "-")) _nat)] specifies a maximum - version. The @schemeidfont{=}, @schemeidfont{+}, and @schemeidfont{-} + @racket[(_nat _nat)] specifies an inclusive range, @racket[((unsyntax + (racketidfont "=")) _nat)] specifies an exact match, + @racket[((unsyntax (racketidfont "+")) _nat)] specifies a minimum + version and is equivalent to just @racket[_nat], and + @racket[((unsyntax (racketidfont "-")) _nat)] specifies a maximum + version. The @racketidfont{=}, @racketidfont{+}, and @racketidfont{-} identifiers in a minor-version constraint are recognized symbolically. @@ -649,7 +649,7 @@ an identifier can be either imported or defined for a given @tech{phase level}, but not both.} -@guideintro["module-provide"]{@scheme[provide]} +@guideintro["module-provide"]{@racket[provide]} @defform/subs[#:literals (protect-out all-defined-out all-from-out rename-out except-out prefix-out struct-out for-meta combine-out @@ -671,54 +671,54 @@ an identifier can be either imported or defined for a given derived-provide-spec] [phase-level exact-integer #f])]{ -Declares exports from a module. A @scheme[provide] form must appear in +Declares exports from a module. A @racket[provide] form must appear in a @tech{module context} or a @tech{module-begin context}. -A @scheme[provide-spec] indicates one or more bindings to provide. +A @racket[provide-spec] indicates one or more bindings to provide. For each exported binding, the external name is a symbol that can be different from the symbolic form of the identifier that is bound within the module. Also, each export is drawn from a particular @tech{phase level} and exported at the same @tech{phase level}. -The syntax of @scheme[provide-spec] can be extended via -@scheme[define-provide-syntax], but the pre-defined forms are as +The syntax of @racket[provide-spec] can be extended via +@racket[define-provide-syntax], but the pre-defined forms are as follows. - @specsubform[id]{ Exports @scheme[id], which must be @tech{bound} + @specsubform[id]{ Exports @racket[id], which must be @tech{bound} within the module (i.e., either defined or imported) at the relevant - @tech{phase level}. The symbolic form of @scheme[id] is used as the + @tech{phase level}. The symbolic form of @racket[id] is used as the external name, and the symbolic form of the defined or imported identifier must match (otherwise, the external name could be ambiguous). @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide num-eggs) (define num-eggs 2)) (require 'nest) num-eggs ] - If @scheme[id] has a transformer binding to a @tech{rename + If @racket[id] has a transformer binding to a @tech{rename transformer}, then the exported binding is the target identifier of - the @tech{rename transformer}, instead of @scheme[id], unless the + the @tech{rename transformer}, instead of @racket[id], unless the target identifier has a true value for the - @scheme['not-free-identifier=?] @tech{syntax property}.} + @racket['not-free-identifier=?] @tech{syntax property}.} @defsubform[(all-defined-out)]{ Exports all identifiers that are defined at @tech{phase level} 0 or @tech{phase level} 1 within the exporting module, and that have the same lexical context as the - @scheme[(all-defined-out)] form, excluding bindings to @tech{rename + @racket[(all-defined-out)] form, excluding bindings to @tech{rename transformers} where the target identifier has the - @scheme['not-provide-all-defined] @tech{syntax property}. The + @racket['not-provide-all-defined] @tech{syntax property}. The external name for each identifier is the symbolic form of the identifier. Only identifiers accessible from the lexical context of - the @scheme[(all-defined-out)] form are included; that is, + the @racket[(all-defined-out)] form are included; that is, macro-introduced imports are not re-exported, unless the - @scheme[(all-defined-out)] form was introduced at the same time. + @racket[(all-defined-out)] form was introduced at the same time. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide (all-defined-out)) (define num-eggs 2)) (require 'nest) @@ -727,20 +727,20 @@ follows. @defsubform[(all-from-out module-path ...)]{ Exports all identifiers that are imported into the exporting module using a - @scheme[require-spec] built on each @scheme[module-path] (see + @racket[require-spec] built on each @racket[module-path] (see @secref["require"]) with no @tech{phase-level} shift. The symbolic name for export is derived from the name that is bound within the module, as opposed to the symbolic name of the export from each - @scheme[module-path]. Only identifiers accessible from the lexical - context of the @scheme[module-path] are included; that is, + @racket[module-path]. Only identifiers accessible from the lexical + context of the @racket[module-path] are included; that is, macro-introduced imports are not re-exported, unless the - @scheme[module-path] was introduced at the same time. + @racket[module-path] was introduced at the same time. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide num-eggs) (define num-eggs 2)) - (module hen-house scheme + (module hen-house racket (require 'nest) (provide (all-from-out 'nest))) (require 'hen-house) @@ -748,12 +748,12 @@ follows. ]} @defsubform[(rename-out [orig-id export-id] ...)]{ Exports each - @scheme[orig-id], which must be @tech{bound} within the module at + @racket[orig-id], which must be @tech{bound} within the module at @tech{phase level} 0. The symbolic name for each export is - @scheme[export-id] instead @scheme[orig-d]. + @racket[export-id] instead @racket[orig-d]. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide (rename-out [count num-eggs])) (define count 2)) (require 'nest) @@ -762,14 +762,14 @@ follows. ]} @defsubform[(except-out provide-spec provide-spec ...)]{ Like the - first @scheme[provide-spec], but omitting the bindings listed in each - subsequent @scheme[provide-spec]. If one of the latter bindings is - not included in the initial @scheme[provide-spec], a syntax error is + first @racket[provide-spec], but omitting the bindings listed in each + subsequent @racket[provide-spec]. If one of the latter bindings is + not included in the initial @racket[provide-spec], a syntax error is reported. The symbolic export name information in the latter - @scheme[provide-spec]s is ignored; only the bindings are used. + @racket[provide-spec]s is ignored; only the bindings are used. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide (except-out (all-defined-out) num-chicks)) (define num-eggs 2) @@ -780,11 +780,11 @@ follows. ]} @defsubform[(prefix-out prefix-id provide-spec)]{ - Like @scheme[provide-spec], but with each symbolic export name from - @scheme[provide-spec] prefixed with @scheme[prefix-id]. + Like @racket[provide-spec], but with each symbolic export name from + @racket[provide-spec] prefixed with @racket[prefix-id]. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide (prefix-out chicken: num-eggs)) (define num-eggs 2)) (require 'nest) @@ -792,32 +792,31 @@ follows. ]} @defsubform[(struct-out id)]{Exports the bindings associated with a - structure type @scheme[id]. Typically, @scheme[id] is bound with - @scheme[(define-struct id ....)] or @scheme[(define-struct (id - _super-id) ....)]; more generally, @scheme[id] must have a + structure type @racket[id]. Typically, @racket[id] is bound with + @racket[(struct id ....)]; more generally, @racket[id] must have a @tech{transformer binding} of structure-type information at @tech{phase level} 0; see @secref["structinfo"]. Furthermore, for each identifier mentioned in the structure-type information, the enclosing module must define or import one identifier that is - @scheme[free-identifier=?]. If the structure-type information + @racket[free-identifier=?]. If the structure-type information includes a super-type identifier, and if the identifier has a @tech{transformer binding} of structure-type information, the accessor and mutator bindings of the super-type are @italic{not} - included by @scheme[struct-out] for export. + included by @racket[struct-out] for export. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide (struct-out egg)) - (define-struct egg (color wt))) + (struct egg (color wt))) (require 'nest) - (egg-color (make-egg 'blue 10)) + (egg-color (egg 'blue 10)) ]} @defsubform[(combine-out provide-spec ...)]{ The union of the - @scheme[provide-spec]s. + @racket[provide-spec]s. @defexamples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide (combine-out num-eggs num-chicks)) (define num-eggs 2) (define num-chicks 1)) @@ -827,12 +826,12 @@ follows. ]} @defsubform[(protect-out provide-spec ...)]{ Like the union of the - @scheme[provide-spec]s, except that the exports are protected; see - @secref["modprotect"]. The @scheme[provide-spec] must specify only + @racket[provide-spec]s, except that the exports are protected; see + @secref["modprotect"]. The @racket[provide-spec] must specify only bindings that are defined within the exporting module. @examples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (provide num-eggs (protect-out num-chicks)) (define num-eggs 2) (define num-chicks 3)) @@ -848,16 +847,16 @@ follows. @specsubform[#:literals (for-meta) (for-meta phase-level provide-spec ...)]{ Like the union of the - @scheme[provide-spec]s, but adjusted to apply to @tech{phase level} - specified by @scheme[phase-level] (where @scheme[#f] corresponds to the - @tech{label phase level}). In particular, an @scheme[_id] or @scheme[rename-out] form as - a @scheme[provide-spec] refers to a binding at @scheme[phase-level], an - @scheme[all-defined-out] exports only @scheme[phase-level] - definitions, and an @scheme[all-from-out] exports bindings - imported with a shift by @scheme[phase-level]. + @racket[provide-spec]s, but adjusted to apply to @tech{phase level} + specified by @racket[phase-level] (where @racket[#f] corresponds to the + @tech{label phase level}). In particular, an @racket[_id] or @racket[rename-out] form as + a @racket[provide-spec] refers to a binding at @racket[phase-level], an + @racket[all-defined-out] exports only @racket[phase-level] + definitions, and an @racket[all-from-out] exports bindings + imported with a shift by @racket[phase-level]. @examples[#:eval (syntax-eval) - (module nest scheme + (module nest racket (define-for-syntax eggs 2) (define chickens 3) (provide (for-syntax eggs) @@ -869,13 +868,13 @@ follows. (test-eggs) chickens - (module broken-nest scheme + (module broken-nest racket (define eggs 2) (define chickens 3) (provide (for-syntax eggs) chickens)) - (module nest2 scheme + (module nest2 racket (define-for-syntax eggs 2) (provide (for-syntax eggs))) (require (for-meta 2 racket/base) @@ -892,136 +891,136 @@ follows. @specsubform[#:literals (for-syntax) (for-syntax provide-spec ...)]{Same as - @scheme[(for-meta 1 provide-spec ...)].} + @racket[(for-meta 1 provide-spec ...)].} @specsubform[#:literals (for-template) (for-template provide-spec ...)]{Same as - @scheme[(for-meta -1 provide-spec ...)].} + @racket[(for-meta -1 provide-spec ...)].} @specsubform[#:literals (for-label) (for-label provide-spec ...)]{Same as - @scheme[(for-meta #f provide-spec ...)].} + @racket[(for-meta #f provide-spec ...)].} - @specsubform[derived-provide-spec]{See @scheme[define-provide-syntax] - for information on expanding the set of @scheme[provide-spec] forms.} + @specsubform[derived-provide-spec]{See @racket[define-provide-syntax] + for information on expanding the set of @racket[provide-spec] forms.} Each export specified within a module must have a distinct symbolic export name, though the same binding can be specified with the multiple symbolic names.} -@defform[(for-meta phase-level require-spec ...)]{See @scheme[require] and @scheme[provide].} -@defform[(for-syntax require-spec ...)]{See @scheme[require] and @scheme[provide].} @defform[(for-template require-spec ...)]{See @scheme[require] and @scheme[provide].} -@defform[(for-label require-spec ...)]{See @scheme[require] and @scheme[provide].} +@defform[(for-meta phase-level require-spec ...)]{See @racket[require] and @racket[provide].} +@defform[(for-syntax require-spec ...)]{See @racket[require] and @racket[provide].} @defform[(for-template require-spec ...)]{See @racket[require] and @racket[provide].} +@defform[(for-label require-spec ...)]{See @racket[require] and @racket[provide].} @defform/subs[(#%require raw-require-spec ...) ([raw-require-spec phaseless-spec - (#,(schemeidfont "for-meta") phase-level phaseless-spec ...) - (#,(schemeidfont "for-syntax") phaseless-spec ...) - (#,(schemeidfont "for-template") phaseless-spec ...) - (#,(schemeidfont "for-label") phaseless-spec ...) - (#,(schemeidfont "just-meta") phase-level raw-require-spec ...)] + (#,(racketidfont "for-meta") phase-level phaseless-spec ...) + (#,(racketidfont "for-syntax") phaseless-spec ...) + (#,(racketidfont "for-template") phaseless-spec ...) + (#,(racketidfont "for-label") phaseless-spec ...) + (#,(racketidfont "just-meta") phase-level raw-require-spec ...)] [phase-level exact-integer #f] [phaseless-spec raw-module-path - (#,(schemeidfont "only") raw-module-path id ...) - (#,(schemeidfont "prefix") prefix-id raw-module-path) - (#,(schemeidfont "all-except") raw-module-path id ...) - (#,(schemeidfont "prefix-all-except") prefix-id + (#,(racketidfont "only") raw-module-path id ...) + (#,(racketidfont "prefix") prefix-id raw-module-path) + (#,(racketidfont "all-except") raw-module-path id ...) + (#,(racketidfont "prefix-all-except") prefix-id raw-module-path id ...) - (#,(schemeidfont "rename") raw-module-path local-id exported-id)] - [raw-module-path (#,(schemeidfont "quote") id) + (#,(racketidfont "rename") raw-module-path local-id exported-id)] + [raw-module-path (#,(racketidfont "quote") id) rel-string - (#,(schemeidfont "lib") rel-string ...) + (#,(racketidfont "lib") rel-string ...) id - (#,(schemeidfont "file") string) - (#,(schemeidfont "planet") rel-string + (#,(racketidfont "file") string) + (#,(racketidfont "planet") rel-string (user-string pkg-string vers ...))])]{ -The primitive import form, to which @scheme[require] expands. A -@scheme[raw-require-spec] is similar to a @scheme[_require-spec] in a -@scheme[require] form, except that the syntax is more constrained, not +The primitive import form, to which @racket[require] expands. A +@racket[raw-require-spec] is similar to a @racket[_require-spec] in a +@racket[require] form, except that the syntax is more constrained, not composable, and not extensible. Also, sub-form names like -@schemeidfont{for-syntax} and @schemeidfont{lib} are recognized +@racketidfont{for-syntax} and @racketidfont{lib} are recognized symbolically, instead of via bindings. Although not formalized in the -grammar above, a @schemeidfont{just-meta} form cannot appear within a -@schemeidfont{just-meta} form. +grammar above, a @racketidfont{just-meta} form cannot appear within a +@racketidfont{just-meta} form. -Each @scheme[raw-require-spec] corresponds to the obvious -@scheme[_require-spec], but the @schemeidfont{rename} sub-form has the -identifiers in reverse order compared to @scheme[rename-in]. +Each @racket[raw-require-spec] corresponds to the obvious +@racket[_require-spec], but the @racketidfont{rename} sub-form has the +identifiers in reverse order compared to @racket[rename-in]. -For most @scheme[raw-require-spec]s, the lexical context of the -@scheme[raw-require-spec] determines the context of introduced -identifiers. The exception is the @schemeidfont{rename} sub-form, -where the lexical context of the @scheme[local-id] is preserved.} +For most @racket[raw-require-spec]s, the lexical context of the +@racket[raw-require-spec] determines the context of introduced +identifiers. The exception is the @racketidfont{rename} sub-form, +where the lexical context of the @racket[local-id] is preserved.} @defform/subs[(#%provide raw-provide-spec ...) ([raw-provide-spec phaseless-spec - (#,(schemeidfont "for-meta") phase-level phaseless-spec) - (#,(schemeidfont "for-syntax") phaseless-spec) - (#,(schemeidfont "for-label") phaseless-spec) - (#,(schemeidfont "protect") raw-provide-spec)] + (#,(racketidfont "for-meta") phase-level phaseless-spec) + (#,(racketidfont "for-syntax") phaseless-spec) + (#,(racketidfont "for-label") phaseless-spec) + (#,(racketidfont "protect") raw-provide-spec)] [phase-level exact-integer #f] [phaseless-spec id - (#,(schemeidfont "rename") local-id export-id) - (#,(schemeidfont "struct") struct-id (field-id ...)) - (#,(schemeidfont "all-from") raw-module-path) - (#,(schemeidfont "all-from-except") raw-module-path id ...) - (#,(schemeidfont "all-defined")) - (#,(schemeidfont "all-defined-except") id ...) - (#,(schemeidfont "prefix-all-defined") prefix-id) - (#,(schemeidfont "prefix-all-defined-except") prefix-id id ...) - (#,(schemeidfont "protect") phaseless-spec ...) - (#,(schemeidfont "expand") (id . datum))])]{ + (#,(racketidfont "rename") local-id export-id) + (#,(racketidfont "struct") struct-id (field-id ...)) + (#,(racketidfont "all-from") raw-module-path) + (#,(racketidfont "all-from-except") raw-module-path id ...) + (#,(racketidfont "all-defined")) + (#,(racketidfont "all-defined-except") id ...) + (#,(racketidfont "prefix-all-defined") prefix-id) + (#,(racketidfont "prefix-all-defined-except") prefix-id id ...) + (#,(racketidfont "protect") phaseless-spec ...) + (#,(racketidfont "expand") (id . datum))])]{ -The primitive export form, to which @scheme[provide] expands. A -@scheme[_raw-module-path] is as for @scheme[#%require]. A -@schemeidfont{protect} sub-form cannot appear within a -@scheme[protect] sub-form. +The primitive export form, to which @racket[provide] expands. A +@racket[_raw-module-path] is as for @racket[#%require]. A +@racketidfont{protect} sub-form cannot appear within a +@racket[protect] sub-form. -Like @scheme[#%require], the sub-form keywords for @scheme[#%provide] +Like @racket[#%require], the sub-form keywords for @racket[#%provide] are recognized symbolically, and nearly every -@scheme[raw-provide-spec] has an obvious equivalent -@scheme[_provide-spec] via @scheme[provide], with the exception of the -@schemeidfont{struct} and @schemeidfont{expand} sub-forms. +@racket[raw-provide-spec] has an obvious equivalent +@racket[_provide-spec] via @racket[provide], with the exception of the +@racketidfont{struct} and @racketidfont{expand} sub-forms. -A @scheme[(#,(schemeidfont "struct") struct-id (field-id ...))] -sub-form expands to @scheme[struct-id], -@schemeidfont{make-}@scheme[struct-id], -@schemeidfont{struct:}@scheme[struct-id], -@scheme[struct-id]@schemeidfont{?}, -@scheme[struct-id]@schemeidfont{-}@scheme[field-id] for each -@scheme[field-id], and -@schemeidfont{set-}@scheme[struct-id]@schemeidfont{-}@scheme[field-id]@schemeidfont{!} -for each @scheme[field-id]. The lexical context of the -@scheme[struct-id] is used for all generated identifiers. +A @racket[(#,(racketidfont "struct") struct-id (field-id ...))] +sub-form expands to @racket[struct-id], +@racketidfont{make-}@racket[struct-id], +@racketidfont{struct:}@racket[struct-id], +@racket[struct-id]@racketidfont{?}, +@racket[struct-id]@racketidfont{-}@racket[field-id] for each +@racket[field-id], and +@racketidfont{set-}@racket[struct-id]@racketidfont{-}@racket[field-id]@racketidfont{!} +for each @racket[field-id]. The lexical context of the +@racket[struct-id] is used for all generated identifiers. -Unlike @scheme[#%require], the @scheme[#%provide] form is -macro-extensible via an explicit @schemeidfont{expand} sub-form; the -@scheme[(id . datum)] part is locally expanded as an expression (even +Unlike @racket[#%require], the @racket[#%provide] form is +macro-extensible via an explicit @racketidfont{expand} sub-form; the +@racket[(id . datum)] part is locally expanded as an expression (even though it is not actually an expression), stopping when a -@scheme[begin] form is produced; if the expansion result is -@scheme[(begin raw-provide-spec ...)], it is spliced in place of the -@schemeidfont{expand} form, otherwise a syntax error is reported. The -@schemeidfont{expand} sub-form is not normally used directly; it -provides a hook for implementing @scheme[provide] and @tech{provide +@racket[begin] form is produced; if the expansion result is +@racket[(begin raw-provide-spec ...)], it is spliced in place of the +@racketidfont{expand} form, otherwise a syntax error is reported. The +@racketidfont{expand} sub-form is not normally used directly; it +provides a hook for implementing @racket[provide] and @tech{provide transformers}. -The @schemeidfont{all-from} and @schemeidfont{all-from-except} forms +The @racketidfont{all-from} and @racketidfont{all-from-except} forms re-export only identifiers that are accessible in lexical context of -the @schemeidfont{all-from} or @schemeidfont{all-from-except} form +the @racketidfont{all-from} or @racketidfont{all-from-except} form itself. That is, macro-introduced imports are not re-exported, unless -the @schemeidfont{all-from} or @schemeidfont{all-from-except} form was -introduced at the same time. Similarly, @schemeidfont{all-defined} and +the @racketidfont{all-from} or @racketidfont{all-from-except} form was +introduced at the same time. Similarly, @racketidfont{all-defined} and its variants export only definitions accessible from the lexical -context of the @scheme[phaseless-spec] form.} +context of the @racket[phaseless-spec] form.} @; -------------------- -@subsection{Additional @scheme[require] Forms} +@subsection{Additional @racket[require] Forms} @note-lib-only[racket/require] @@ -1029,8 +1028,8 @@ The following forms support more complex selection and manipulation of sets of imported identifiers. @defform[(matching-identifiers-in regexp require-spec)]{ Like - @scheme[require-spec], but including only imports whose names match - @scheme[regexp]. The @scheme[regexp] must be a literal regular + @racket[require-spec], but including only imports whose names match + @racket[regexp]. The @racket[regexp] must be a literal regular expression (see @secref["regexp"]). @defexamples[#:eval (syntax-eval) @@ -1052,21 +1051,21 @@ monkey ]} @defform[(subtract-in require-spec subtracted-spec ...)]{ Like - @scheme[require-spec], but omitting those imports that would be - imported by one of the @scheme[subtracted-spec]s. + @racket[require-spec], but omitting those imports that would be + imported by one of the @racket[subtracted-spec]s. @defexamples[#:eval (syntax-eval) -(module earth scheme +(module earth racket (provide land sea air) (define land 1) (define sea 2) (define air 3)) -(module mars scheme +(module mars racket (provide aliens) (define aliens 4)) -(module solar-system scheme +(module solar-system racket (require 'earth 'mars) (provide (all-from-out 'earth) (all-from-out 'mars))) @@ -1077,40 +1076,39 @@ land aliens ]} -@defform[(filtered-in proc-expr require-spec)]{ The @scheme[proc-expr] - should evaluate to a single-argument procedure, which is applied on - each of the names (as strings) that are to be required according to - @scheme[require-spec]. For each name, the procedure should return - either a string (possibly different if you want it renamed), or - @scheme[#f] to exclude the name. (Note that @scheme[proc-expr] is a - syntax-time expression.) +@defform[(filtered-in proc-expr require-spec)]{ + + Applies an arbitrary transformation on the import names (as strings) + of @scheme[require-spec]. The @racket[proc-expr] must evaluate at + expansion time to a single-argument procedure, which is applied on + each of the names from @racket[require-spec]. For each name, the + procedure must return either a string for the import's new name or + @racket[#f] to exclude the import. For example, - @schemeblock[ + @racketblock[ (require (filtered-in (lambda (name) (and (regexp-match? #rx"^[a-z-]+$" name) - (regexp-replace - #rx"-" (string-titlecase name) ""))) + (regexp-replace #rx"-" (string-titlecase name) ""))) racket/base))] - will get the @scheme[racket/base] bindings that match the regexp, - and renamed to use ``camel case.''} + imports only bindings from @racketmodname[racket/base] that match the + pattern @scheme[#rx"^[a-z-]+$"], and it converts the names to ``camel case.''} @defform[(path-up rel-string ...)]{ -This specifies paths to module named by the @scheme[rel-string]s in a -similar way to using the @scheme[rel-string]s directly, except that if the -required module files are not found there, they are searched for in the parent -directory (in @filepath{../@scheme[_rel-string]}), and then in -the grand-parent directory, going all the way up to the root. (Note -that the usual caveats hold for a macro that depends on files that it -looks for to determine its expansion: the resulting path becomes part -of the compiled form.) +Specifies paths to modules named by the @racket[rel-string]s similar +to using the @racket[rel-string]s directly, except that if a required +module file is not found relative to the enclosing source, it is +searched for in the parent directory, and then in the grand-parent +directory, etc., all the way to the root directory. The discovered +path relative to the enclosing source becomes part of the expanded +form. This form is useful in setting up a ``project environment''. For example, you can write a @filepath{config.ss} file in the root directory of your project with: -@schememod[ +@racketmod[ racket/base (require racket/require-syntax (for-syntax "utils/in-here.ss")) ;; require form for my utilities @@ -1118,7 +1116,7 @@ directory of your project with: (define-require-syntax utils-in in-here-transformer) ] and in @filepath{utils/in-here.ss} in the root: -@schememod[ +@racketmod[ racket/base (require racket/runtime-path) (provide in-here-transformer) @@ -1130,15 +1128,15 @@ and in @filepath{utils/in-here.ss} in the root: (let ([path (build-path here (format "~a.ss" (syntax-e #'sym)))]) (datum->syntax stx `(file ,(path->string path)) stx))])) ] -Finally, you can use it via @scheme[path-up]: -@schemeblock[ +Finally, you can use it via @racket[path-up]: +@racketblock[ (require racket/require (path-up "config.ss") (utils-in foo))] -Note that the order of requires in this form is important, as each of +Note that the order of requires in this example is important, as each of the first two bind the identifier used in the following. -An alternative in this scenario is to use @scheme[path-up] directly to +An alternative in this scenario is to use @racket[path-up] directly to get to the utility module: -@schemeblock[ +@racketblock[ (require racket/require (path-up "utils/foo.ss"))] but then you need to be careful with subdirectories that are called @filepath{utils}, which will override the one in the project's root. @@ -1146,52 +1144,49 @@ In other words, the previous method requires a single unique name.} @; -------------------- -@subsection{Additional @scheme[provide] Forms} +@subsection{Additional @racket[provide] Forms} @note-lib-only[racket/provide] @defform[(matching-identifiers-out regexp provide-spec)]{ Like - @scheme[provide-spec], but including only exports of bindings with - an external name that matches @scheme[regexp]. The @scheme[regexp] + @racket[provide-spec], but including only exports of bindings with + an external name that matches @racket[regexp]. The @racket[regexp] must be a literal regular expression (see @secref["regexp"]).} -@defform[(filtered-out proc-expr provide-spec)]{ The - @scheme[proc-expr] should evaluate to a single-argument procedure, - which is applied on each of the names (as strings) that are to be - provided according to @scheme[provide-spec]. For each name, the - procedure should return either a string (possibly different if you - want it renamed), or @scheme[#f] to exclude the name. (Note that - @scheme[proc-expr] is a syntax-time expression.) +@defform[(filtered-out proc-expr provide-spec)]{ + + Analogous to @scheme[filtered-in], but for filtering and renaming + exports. For example, - @schemeblock[ + @racketblock[ (provide (filtered-out (lambda (name) (and (regexp-match? #rx"^[a-z-]+$" name) (regexp-replace #rx"-" (string-titlecase name) ""))) (all-defined-out)))] - will provide all defined bindings that match the regexp, and renamed - to use ``camel case''.} + exports only bindings that match the + pattern @scheme[#rx"^[a-z-]+$"], and it converts the names to ``camel case.''} @;------------------------------------------------------------------------ -@section[#:tag "quote"]{Literals: @scheme[quote] and @scheme[#%datum]} +@section[#:tag "quote"]{Literals: @racket[quote] and @racket[#%datum]} -Many forms are implicitly quoted (via @scheme[#%datum]) as literals. See +Many forms are implicitly quoted (via @racket[#%datum]) as literals. See @secref["expand-steps"] for more information. -@guideintro["quote"]{@scheme[quote]} +@guideintro["quote"]{@racket[quote]} @defform[(quote datum)]{ -Produces a constant value corresponding to @scheme[datum] (i.e., the +Produces a constant value corresponding to @racket[datum] (i.e., the representation of the program fragment) without its @tech{lexical information}, source location, etc. Quoted pairs, vectors, and boxes are immutable. @mz-examples[ -(eval:alts (#,(schemekeywordfont "quote") x) 'x) -(eval:alts (#,(schemekeywordfont "quote") (+ 1 2)) '(+ 1 2)) +(eval:alts (#,(racketkeywordfont "quote") x) 'x) +(eval:alts (#,(racketkeywordfont "quote") (+ 1 2)) '(+ 1 2)) (+ 1 2) ] @@ -1199,12 +1194,12 @@ are immutable. @defform[(#%datum . datum)]{ -Expands to @scheme[(#,(schemekeywordfont "quote") datum)], as long as -@scheme[datum] is not a keyword. If @scheme[datum] is a keyword, a +Expands to @racket[(#,(racketkeywordfont "quote") datum)], as long as +@racket[datum] is not a keyword. If @racket[datum] is a keyword, a syntax error is reported. See also @secref["expand-steps"] for information on how the expander -introduces @schemeidfont{#%datum} identifiers. +introduces @racketidfont{#%datum} identifiers. @mz-examples[ (#%datum . 10) @@ -1214,12 +1209,12 @@ introduces @schemeidfont{#%datum} identifiers. } @;------------------------------------------------------------------------ -@section[#:tag "#%expression"]{Expression Wrapper: @scheme[#%expression]} +@section[#:tag "#%expression"]{Expression Wrapper: @racket[#%expression]} @defform[(#%expression expr)]{ -Produces the same result as @scheme[expr]. The only use of -@scheme[#%expression] is to force the parsing of a form as an +Produces the same result as @racket[expr]. The only use of +@racket[#%expression] is to force the parsing of a form as an expression. @mz-examples[ @@ -1228,20 +1223,20 @@ expression. ]} @;------------------------------------------------------------------------ -@section[#:tag "#%top"]{Variable References and @scheme[#%top]} +@section[#:tag "#%top"]{Variable References and @racket[#%top]} @defform/none[id]{ -Refers to a module-level or local binding, when @scheme[id] is +Refers to a module-level or local binding, when @racket[id] is not bound as a transformer (see @secref["expansion"]). At run-time, the reference evaluates to the value in the location associated with the binding. -When the expander encounters an @scheme[id] that is not bound by a +When the expander encounters an @racket[id] that is not bound by a module-level or local binding, it converts the expression to -@scheme[(@#,schemeidfont{#%top} . id)] giving @schemeidfont{#%top} -the lexical context of the @scheme[id]; typically, that context refers -to @scheme[#%top]. See also @secref["expand-steps"]. +@racket[(@#,racketidfont{#%top} . id)] giving @racketidfont{#%top} +the lexical context of the @racket[id]; typically, that context refers +to @racket[#%top]. See also @secref["expand-steps"]. @examples[ (define x 10) @@ -1252,11 +1247,11 @@ x @defform[(#%top . id)]{ -Refers to a top-level definition that could bind @scheme[id], even if -@scheme[id] has a local binding in its context. Such references are -disallowed anywhere within a @scheme[module] form. See also +Refers to a top-level definition that could bind @racket[id], even if +@racket[id] has a local binding in its context. Such references are +disallowed anywhere within a @racket[module] form. See also @secref["expand-steps"] for information on how the expander -introduces @schemeidfont{#%top} identifiers. +introduces @racketidfont{#%top} identifiers. @examples[ (define x 12) @@ -1264,7 +1259,7 @@ introduces @schemeidfont{#%top} identifiers. ]} @;------------------------------------------------------------------------ -@section{Locations: @scheme[#%variable-reference]} +@section{Locations: @racket[#%variable-reference]} @defform*[#:literals (#%top) [(#%variable-reference id) @@ -1272,24 +1267,24 @@ introduces @schemeidfont{#%top} identifiers. (#%variable-reference)]]{ Produces an opaque @deftech{variable reference} value representing the -location of @scheme[id], which must be bound as a @tech{top-level -variable} or @tech{module-level variable}. If no @scheme[id] is +location of @racket[id], which must be bound as a @tech{top-level +variable} or @tech{module-level variable}. If no @racket[id] is supplied, the resulting value refers to an ``anonymous'' variable defined within the enclosing context (i.e., within the enclosing module, or at the top level if the form is not inside a module). A @tech{variable reference} can be used with -@scheme[variable-reference->empty-namespace], -@scheme[variable-reference->resolved-module-path], and -@scheme[variable-reference->top-level-namespace], but facilities like -@scheme[define-namespace-anchor] and -@scheme[namespace-anchor->namespace] wrap those to provide an clearer +@racket[variable-reference->empty-namespace], +@racket[variable-reference->resolved-module-path], and +@racket[variable-reference->top-level-namespace], but facilities like +@racket[define-namespace-anchor] and +@racket[namespace-anchor->namespace] wrap those to provide an clearer interface. A @tech{variable reference} is also useful to low-level extensions; see @other-manual['(lib "scribblings/inside/inside.scrbl")].} @;------------------------------------------------------------------------ -@section[#:tag "application"]{Procedure Applications and @scheme[#%app]} +@section[#:tag "application"]{Procedure Applications and @racket[#%app]} @section-index{evaluation order} @@ -1297,16 +1292,16 @@ extensions; see @other-manual['(lib @defform/none[(proc-expr arg ...)]{ -Applies a procedure, when @scheme[proc-expr] is not an +Applies a procedure, when @racket[proc-expr] is not an identifier that has a transformer binding (see @secref["expansion"]). More precisely, the expander converts this form to -@scheme[(@#,schemeidfont{#%app} proc-expr arg ...)], giving -@schemeidfont{#%app} the lexical context that is associated with the -original form (i.e., the pair that combines @scheme[proc-expr] and its +@racket[(@#,racketidfont{#%app} proc-expr arg ...)], giving +@racketidfont{#%app} the lexical context that is associated with the +original form (i.e., the pair that combines @racket[proc-expr] and its arguments). Typically, the lexical context of the pair indicates the -procedure-application @scheme[#%app] that is described next. See also +procedure-application @racket[#%app] that is described next. See also @secref["expand-steps"]. @mz-examples[ @@ -1316,37 +1311,37 @@ procedure-application @scheme[#%app] that is described next. See also @defform[(#%app proc-expr arg ...)]{ -Applies a procedure. Each @scheme[arg] is one of the following: +Applies a procedure. Each @racket[arg] is one of the following: @specsubform[arg-expr]{The resulting value is a non-keyword argument.} @specsubform[(code:line keyword arg-expr)]{The resulting value is a - keyword argument using @scheme[keyword]. Each - @scheme[keyword] in the application must be distinct.} + keyword argument using @racket[keyword]. Each + @racket[keyword] in the application must be distinct.} -The @scheme[proc-expr] and @scheme[_arg-expr]s are evaluated in order, -left to right. If the result of @scheme[proc-expr] is a procedure that -accepts as many arguments as non-@scheme[_keyword] -@scheme[_arg-expr]s, if it accepts arguments for all of the -@scheme[_keyword]s in the application, and if all required -keyword-based arguments are represented among the @scheme[_keyword]s +The @racket[proc-expr] and @racket[_arg-expr]s are evaluated in order, +left to right. If the result of @racket[proc-expr] is a procedure that +accepts as many arguments as non-@racket[_keyword] +@racket[_arg-expr]s, if it accepts arguments for all of the +@racket[_keyword]s in the application, and if all required +keyword-based arguments are represented among the @racket[_keyword]s in the application, then the procedure is called with the values of -the @scheme[arg-expr]s. Otherwise, the @exnraise[exn:fail:contract]. +the @racket[arg-expr]s. Otherwise, the @exnraise[exn:fail:contract]. The continuation of the procedure call is the same as the continuation of the application expression, so the results of the procedure are the results of the application expression. -The relative order of @scheme[_keyword]-based arguments matters only -for the order of @scheme[_arg-expr] evaluations; the arguments are +The relative order of @racket[_keyword]-based arguments matters only +for the order of @racket[_arg-expr] evaluations; the arguments are associated with argument variables in the applied procedure based on -the @scheme[_keyword]s, and not their positions. The other -@scheme[_arg-expr] values, in contrast, are associated with variables +the @racket[_keyword]s, and not their positions. The other +@racket[_arg-expr] values, in contrast, are associated with variables according to their order in the application form. See also @secref["expand-steps"] for information on how the -expander introduces @schemeidfont{#%app} identifiers. +expander introduces @racketidfont{#%app} identifiers. @mz-examples[ (#%app + 1 2) @@ -1357,11 +1352,11 @@ expander introduces @schemeidfont{#%app} identifiers. @defform*[[(#%plain-app proc-expr arg-expr ...) (#%plain-app)]]{ -Like @scheme[#%app], but without support for keyword arguments. -As a special case, @scheme[(#%plain-app)] produces @scheme['()].} +Like @racket[#%app], but without support for keyword arguments. +As a special case, @racket[(#%plain-app)] produces @racket['()].} @;------------------------------------------------------------------------ -@section[#:tag "lambda"]{Procedure Expressions: @scheme[lambda] and @scheme[case-lambda]} +@section[#:tag "lambda"]{Procedure Expressions: @racket[lambda] and @racket[case-lambda]} @guideintro["lambda"]{procedure expressions} @@ -1377,93 +1372,93 @@ As a special case, @scheme[(#%plain-app)] produces @scheme['()].} (code:line keyword [id default-expr])])] )]{ -Produces a procedure. The @scheme[kw-formals] determines the number of +Produces a procedure. The @racket[kw-formals] determines the number of arguments and which keyword arguments that the procedure accepts. -Considering only the first @scheme[arg] case, a simple -@scheme[kw-formals] has one of the following three forms: +Considering only the first @racket[arg] case, a simple +@racket[kw-formals] has one of the following three forms: @specsubform[(id ...)]{ The procedure accepts as many non-keyword - argument values as the number of @scheme[id]s. Each @scheme[id] + argument values as the number of @racket[id]s. Each @racket[id] is associated with an argument value by position.} @specsubform[(id ...+ . rest-id)]{ The procedure accepts any number of non-keyword arguments greater or equal to the number of - @scheme[id]s. When the procedure is applied, the @scheme[id]s + @racket[id]s. When the procedure is applied, the @racket[id]s are associated with argument values by position, and all leftover arguments are placed into a list that is associated to - @scheme[rest-id].} + @racket[rest-id].} @specsubform[rest-id]{ The procedure accepts any number of non-keyword arguments. All arguments are placed into a list that is - associated with @scheme[rest-id].} + associated with @racket[rest-id].} -More generally, an @scheme[arg] can include a keyword and/or default +More generally, an @racket[arg] can include a keyword and/or default value. Thus, the first two cases above are more completely specified as follows: -@specsubform[(arg ...)]{ Each @scheme[arg] has the following +@specsubform[(arg ...)]{ Each @racket[arg] has the following four forms: @specsubform[id]{Adds one to both the minimum and maximum number of non-keyword arguments accepted by the procedure. The - @scheme[id] is associated with an actual argument by + @racket[id] is associated with an actual argument by position.} @specsubform[[id default-expr]]{Adds one to the maximum number of non-keyword arguments accepted by the procedure. The - @scheme[id] is associated with an actual argument by position, - and if no such argument is provided, the @scheme[default-expr] - is evaluated to produce a value associated with @scheme[id]. - No @scheme[arg] with a @scheme[default-expr] can appear - before an @scheme[id] without a @scheme[default-expr] and - without a @scheme[keyword].} + @racket[id] is associated with an actual argument by position, + and if no such argument is provided, the @racket[default-expr] + is evaluated to produce a value associated with @racket[id]. + No @racket[arg] with a @racket[default-expr] can appear + before an @racket[id] without a @racket[default-expr] and + without a @racket[keyword].} @specsubform[(code:line keyword id)]{The procedure requires a - keyword-based argument using @scheme[keyword]. The @scheme[id] + keyword-based argument using @racket[keyword]. The @racket[id] is associated with a keyword-based actual argument using - @scheme[keyword].} + @racket[keyword].} @specsubform[(code:line keyword [id default-expr])]{The - procedure accepts a keyword-based using @scheme[keyword]. The - @scheme[id] is associated with a keyword-based actual argument - using @scheme[keyword], if supplied in an application; - otherwise, the @scheme[default-expr] is evaluated to obtain a - value to associate with @scheme[id].} + procedure accepts a keyword-based using @racket[keyword]. The + @racket[id] is associated with a keyword-based actual argument + using @racket[keyword], if supplied in an application; + otherwise, the @racket[default-expr] is evaluated to obtain a + value to associate with @racket[id].} - The position of a @scheme[_keyword] @scheme[arg] in - @scheme[kw-formals] does not matter, but each specified - @scheme[keyword] must be distinct.} + The position of a @racket[_keyword] @racket[arg] in + @racket[kw-formals] does not matter, but each specified + @racket[keyword] must be distinct.} @specsubform[(arg ...+ . rest-id)]{ Like the previous case, but the procedure accepts any number of non-keyword arguments beyond its minimum number of arguments. When more arguments are - provided than non-@scheme[_keyword] arguments among the - @scheme[arg]s, the extra arguments are placed into a - list that is associated to @scheme[rest-id].} + provided than non-@racket[_keyword] arguments among the + @racket[arg]s, the extra arguments are placed into a + list that is associated to @racket[rest-id].} -The @scheme[kw-formals] identifiers are bound in the -@scheme[body]s. When the procedure is applied, a new @tech{location} +The @racket[kw-formals] identifiers are bound in the +@racket[body]s. When the procedure is applied, a new @tech{location} is created for each identifier, and the location is filled with the associated argument value. The @tech{locations} are created and filled -in order, with @scheme[_default-expr]s evaluated as needed to fill +in order, with @racket[_default-expr]s evaluated as needed to fill locations. @margin-note{In other words, argument bindings with -default-value expressions are evaluated analogous to @scheme[let*].} +default-value expressions are evaluated analogous to @racket[let*].} -If any identifier appears in the @scheme[body]s that is not one of the -identifiers in @scheme[kw-formals], then it refers to the same -location that it would if it appeared in place of the @scheme[lambda] +If any identifier appears in the @racket[body]s that is not one of the +identifiers in @racket[kw-formals], then it refers to the same +location that it would if it appeared in place of the @racket[lambda] expression. (In other words, variable reference is lexically scoped.) -When multiple identifiers appear in a @scheme[kw-formals], they must -be distinct according to @scheme[bound-identifier=?]. +When multiple identifiers appear in a @racket[kw-formals], they must +be distinct according to @racket[bound-identifier=?]. -If the procedure produced by @scheme[lambda] is applied to fewer or +If the procedure produced by @racket[lambda] is applied to fewer or more by-position or by-keyword arguments than it accepts, to by-keyword arguments that it does not accept, or without required by-keyword arguments, then the @exnraise[exn:fail:contract]. -The last @scheme[body] expression is in tail position with respect to +The last @racket[body] expression is in tail position with respect to the procedure body. @mz-examples[ @@ -1475,17 +1470,17 @@ the procedure body. (f #:arg 2 1))) ] -When compiling a @scheme[lambda] or @scheme[case-lambda] expression, -Scheme looks for a @indexed-scheme['method-arity-error] property +When compiling a @racket[lambda] or @racket[case-lambda] expression, +Racket looks for a @indexed-racket['method-arity-error] property attached to the expression (see @secref["stxprops"]). If it is present with a true value, and if no case of the procedure accepts zero arguments, then the procedure is marked so that an -@scheme[exn:fail:contract:arity] exception involving the procedure +@racket[exn:fail:contract:arity] exception involving the procedure will hide the first argument, if one was provided. (Hiding the first argument is useful when the procedure implements a method, where the first argument is implicit in the original source). The property -affects only the format of @scheme[exn:fail:contract:arity] -exceptions, not the result of @scheme[procedure-arity].} +affects only the format of @racket[exn:fail:contract:arity] +exceptions, not the result of @racket[procedure-arity].} @defform/subs[(case-lambda [formals body ...+] ...) @@ -1493,17 +1488,17 @@ exceptions, not the result of @scheme[procedure-arity].} (id ...+ . rest-id) rest-id])]{ -Produces a procedure. Each @scheme[[forms body ...+]] -clause is analogous to a single @scheme[lambda] procedure; applying -the @scheme[case-lambda]-generated procedure is the same as applying a +Produces a procedure. Each @racket[[forms body ...+]] +clause is analogous to a single @racket[lambda] procedure; applying +the @racket[case-lambda]-generated procedure is the same as applying a procedure that corresponds to one of the clauses---the first procedure that accepts the given number of arguments. If no corresponding procedure accepts the given number of arguments, the @exnraise[exn:fail:contract]. -Note that a @scheme[case-lambda] clause supports only -@scheme[formals], not the more general @scheme[_kw-formals] of -@scheme[lambda]. That is, @scheme[case-lambda] does not directly +Note that a @racket[case-lambda] clause supports only +@racket[formals], not the more general @racket[_kw-formals] of +@racket[lambda]. That is, @racket[case-lambda] does not directly support keyword and optional arguments. @mz-examples[ @@ -1519,23 +1514,23 @@ support keyword and optional arguments. ]} @defform[(#%plain-lambda formals body ...+)]{ -Like @scheme[lambda], but without support for keyword or optional arguments. +Like @racket[lambda], but without support for keyword or optional arguments. } @;------------------------------------------------------------------------ -@section[#:tag "let"]{Local Binding: @scheme[let], @scheme[let*], @scheme[letrec], ...} +@section[#:tag "let"]{Local Binding: @racket[let], @racket[let*], @racket[letrec], ...} @guideintro["let"]{local binding} @defform*[[(let ([id val-expr] ...) body ...+) (let proc-id ([id init-expr] ...) body ...+)]]{ -The first form evaluates the @scheme[val-expr]s left-to-right, creates -a new location for each @scheme[id], and places the values into the -locations. It then evaluates the @scheme[body]s, in which the -@scheme[id]s are bound. The last @scheme[body] expression is in -tail position with respect to the @scheme[let] form. The @scheme[id]s -must be distinct according to @scheme[bound-identifier=?]. +The first form evaluates the @racket[val-expr]s left-to-right, creates +a new location for each @racket[id], and places the values into the +locations. It then evaluates the @racket[body]s, in which the +@racket[id]s are bound. The last @racket[body] expression is in +tail position with respect to the @racket[let] form. The @racket[id]s +must be distinct according to @racket[bound-identifier=?]. @mz-examples[ (let ([x 5]) x) @@ -1545,10 +1540,10 @@ must be distinct according to @scheme[bound-identifier=?]. (list y x))) ] -The second form evaluates the @scheme[init-expr]s; the resulting +The second form evaluates the @racket[init-expr]s; the resulting values become arguments in an application of a procedure -@scheme[(lambda (id ...) body ...+)], where @scheme[proc-id] is bound -within the @scheme[body]s to the procedure itself.} +@racket[(lambda (id ...) body ...+)], where @racket[proc-id] is bound +within the @racket[body]s to the procedure itself.} @mz-examples[ (let fac ([n 10]) @@ -1559,10 +1554,10 @@ within the @scheme[body]s to the procedure itself.} @defform[(let* ([id val-expr] ...) body ...+)]{ -Similar to @scheme[let], but evaluates the @scheme[val-expr]s one by -one, creating a location for each @scheme[id] as soon as the value is -available. The @scheme[id]s are bound in the remaining @scheme[val-expr]s -as well as the @scheme[body]s, and the @scheme[id]s need not be +Similar to @racket[let], but evaluates the @racket[val-expr]s one by +one, creating a location for each @racket[id] as soon as the value is +available. The @racket[id]s are bound in the remaining @racket[val-expr]s +as well as the @racket[body]s, and the @racket[id]s need not be distinct; later bindings shadow earlier bindings. @mz-examples[ @@ -1573,11 +1568,11 @@ distinct; later bindings shadow earlier bindings. @defform[(letrec ([id val-expr] ...) body ...+)]{ -Similar to @scheme[let], but the locations for all @scheme[id]s are +Similar to @racket[let], but the locations for all @racket[id]s are created first and filled with @|undefined-const|, and all -@scheme[id]s are bound in all @scheme[val-expr]s as well as the -@scheme[body]s. The @scheme[id]s must be distinct according to -@scheme[bound-identifier=?]. +@racket[id]s are bound in all @racket[val-expr]s as well as the +@racket[body]s. The @racket[id]s must be distinct according to +@racket[bound-identifier=?]. @mz-examples[ (letrec ([is-even? (lambda (n) @@ -1590,10 +1585,10 @@ created first and filled with @|undefined-const|, and all ]} @defform[(let-values ([(id ...) val-expr] ...) body ...+)]{ Like -@scheme[let], except that each @scheme[val-expr] must produce as many -values as corresponding @scheme[id]s, otherwise the +@racket[let], except that each @racket[val-expr] must produce as many +values as corresponding @racket[id]s, otherwise the @exnraise[exn:fail:contract]. A separate location is created for each -@scheme[id], all of which are bound in the @scheme[body]s. +@racket[id], all of which are bound in the @racket[body]s. @mz-examples[ (let-values ([(x y) (quotient/remainder 10 3)]) @@ -1601,10 +1596,10 @@ values as corresponding @scheme[id]s, otherwise the ]} @defform[(let*-values ([(id ...) val-expr] ...) body ...+)]{ Like -@scheme[let*], except that each @scheme[val-expr] must produce as many -values as corresponding @scheme[id]s. A separate location is created -for each @scheme[id], all of which are bound in the later -@scheme[val-expr]s and in the @scheme[body]s. +@racket[let*], except that each @racket[val-expr] must produce as many +values as corresponding @racket[id]s. A separate location is created +for each @racket[id], all of which are bound in the later +@racket[val-expr]s and in the @racket[body]s. @mz-examples[ (let*-values ([(x y) (quotient/remainder 10 3)] @@ -1613,11 +1608,11 @@ for each @scheme[id], all of which are bound in the later ]} @defform[(letrec-values ([(id ...) val-expr] ...) body ...+)]{ Like -@scheme[letrec], except that each @scheme[val-expr] must produce as -many values as corresponding @scheme[id]s. A separate location is -created for each @scheme[id], all of which are initialized to -@|undefined-const| and bound in all @scheme[val-expr]s -and in the @scheme[body]s. +@racket[letrec], except that each @racket[val-expr] must produce as +many values as corresponding @racket[id]s. A separate location is +created for each @racket[id], all of which are initialized to +@|undefined-const| and bound in all @racket[val-expr]s +and in the @racket[body]s. @mz-examples[ (letrec-values ([(is-even? is-odd?) @@ -1633,96 +1628,96 @@ and in the @scheme[body]s. @defform[(let-syntax ([id trans-expr] ...) body ...+)]{ -@margin-note/ref{See also @scheme[splicing-let-syntax].} +@margin-note/ref{See also @racket[splicing-let-syntax].} Creates a @tech{transformer binding} (see -@secref["transformer-model"]) of each @scheme[id] with the value of -@scheme[trans-expr], which is an expression at @tech{phase level} 1 +@secref["transformer-model"]) of each @racket[id] with the value of +@racket[trans-expr], which is an expression at @tech{phase level} 1 relative to the surrounding context. (See @secref["id-model"] for information on @tech{phase levels}.) -The evaluation of each @scheme[trans-expr] is @scheme[parameterize]d -to set @scheme[current-namespace] to a @tech{namespace} that shares +The evaluation of each @racket[trans-expr] is @racket[parameterize]d +to set @racket[current-namespace] to a @tech{namespace} that shares @tech{bindings} and @tech{variables} with the namespace being used to -expand the @scheme[let-syntax] form, except that its @tech{base phase} +expand the @racket[let-syntax] form, except that its @tech{base phase} is one greater. -Each @scheme[id] is bound in the @scheme[body]s, and not in other -@scheme[trans-expr]s.} +Each @racket[id] is bound in the @racket[body]s, and not in other +@racket[trans-expr]s.} @defform[(letrec-syntax ([id trans-expr] ...) body ...+)]{ -@margin-note/ref{See also @scheme[splicing-letrec-syntax].} +@margin-note/ref{See also @racket[splicing-letrec-syntax].} -Like @scheme[let-syntax], except that each @scheme[id] is also bound -within all @scheme[trans-expr]s.} +Like @racket[let-syntax], except that each @racket[id] is also bound +within all @racket[trans-expr]s.} @defform[(let-syntaxes ([(id ...) trans-expr] ...) body ...+)]{ -@margin-note/ref{See also @scheme[splicing-let-syntaxes].} +@margin-note/ref{See also @racket[splicing-let-syntaxes].} -Like @scheme[let-syntax], but each @scheme[trans-expr] must produce as -many values as corresponding @scheme[id]s, each of which is bound to +Like @racket[let-syntax], but each @racket[trans-expr] must produce as +many values as corresponding @racket[id]s, each of which is bound to the corresponding value.} @defform[(letrec-syntaxes ([(id ...) trans-expr] ...) body ...+)]{ -@margin-note/ref{See also @scheme[splicing-letrec-syntaxes].} +@margin-note/ref{See also @racket[splicing-letrec-syntaxes].} -Like @scheme[let-syntax], except that each @scheme[id] is also bound -within all @scheme[trans-expr]s.} +Like @racket[let-syntax], except that each @racket[id] is also bound +within all @racket[trans-expr]s.} @defform[(letrec-syntaxes+values ([(trans-id ...) trans-expr] ...) ([(val-id ...) val-expr] ...) body ...+)]{ -Combines @scheme[letrec-syntaxes] with @scheme[letrec-values]: each -@scheme[trans-id] and @scheme[val-id] is bound in all -@scheme[trans-expr]s and @scheme[val-expr]s. +Combines @racket[letrec-syntaxes] with @racket[letrec-values]: each +@racket[trans-id] and @racket[val-id] is bound in all +@racket[trans-expr]s and @racket[val-expr]s. -The @scheme[letrec-syntaxes+values] form is the core form for local -compile-time bindings, since forms like @scheme[letrec-syntax] and -internal @scheme[define-syntax] expand to it. In a fully expanded -expression (see @secref["fully-expanded"]), the @scheme[trans-id] -bindings are discarded and the form reduces to @scheme[letrec], but -@scheme[letrec-syntaxes+values] can appear in the result of -@scheme[local-expand] with an empty stop list. +The @racket[letrec-syntaxes+values] form is the core form for local +compile-time bindings, since forms like @racket[letrec-syntax] and +internal @racket[define-syntax] expand to it. In a fully expanded +expression (see @secref["fully-expanded"]), the @racket[trans-id] +bindings are discarded and the form reduces to @racket[letrec], but +@racket[letrec-syntaxes+values] can appear in the result of +@racket[local-expand] with an empty stop list. -See also @scheme[local], which supports local bindings with -@scheme[define], @scheme[define-syntax], and more.} +See also @racket[local], which supports local bindings with +@racket[define], @racket[define-syntax], and more.} @;------------------------------------------------------------------------ -@section[#:tag "local"]{Local Definitions: @scheme[local]} +@section[#:tag "local"]{Local Definitions: @racket[local]} @note-lib[racket/local] @defform[(local [definition ...] body ...+)]{ -Like @scheme[letrec], except that the bindings are expressed in the +Like @racket[letrec], except that the bindings are expressed in the same way as in the top-level or in a module body: using -@scheme[define], @scheme[define-values], @scheme[define-syntax], -@scheme[define-struct], etc. Definitions are distinguished from -non-definitions by partially expanding @scheme[definition] forms (see +@racket[define], @racket[define-values], @racket[define-syntax], +@racket[struct], etc. Definitions are distinguished from +non-definitions by partially expanding @racket[definition] forms (see @secref["partial-expansion"]). As in the top-level or in a module -body, a @scheme[begin]-wrapped sequence is spliced into the sequence -of @scheme[definition]s.} +body, a @racket[begin]-wrapped sequence is spliced into the sequence +of @racket[definition]s.} @;------------------------------------------------------------------------ @include-section["shared.scrbl"] @;------------------------------------------------------------------------ -@section[#:tag "if"]{Conditionals: @scheme[if], @scheme[cond], @scheme[and], and @scheme[or]} +@section[#:tag "if"]{Conditionals: @racket[if], @racket[cond], @racket[and], and @racket[or]} @guideintro["conditionals"]{conditionals} @defform[(if test-expr then-expr else-expr)]{ -Evaluates @scheme[test-expr]. If it produces any value other than -@scheme[#f], then @scheme[then-expr] is evaluated, and its results are -the result for the @scheme[if] form. Otherwise, @scheme[else-expr] is -evaluated, and its results are the result for the @scheme[if] -form. The @scheme[then-expr] and @scheme[else-expr] are in tail -position with respect to the @scheme[if] form. +Evaluates @racket[test-expr]. If it produces any value other than +@racket[#f], then @racket[then-expr] is evaluated, and its results are +the result for the @racket[if] form. Otherwise, @racket[else-expr] is +evaluated, and its results are the result for the @racket[if] +form. The @racket[then-expr] and @racket[else-expr] are in tail +position with respect to the @racket[if] form. @mz-examples[ (if (positive? -5) (error "doesn't get here") 2) @@ -1737,42 +1732,42 @@ position with respect to the @scheme[if] form. [test-expr => proc-expr] [test-expr]])]{ -@guideintro["cond"]{@scheme[cond]} +@guideintro["cond"]{@racket[cond]} -A @scheme[cond-clause] that starts with @scheme[else] must be the last -@scheme[cond-clause]. +A @racket[cond-clause] that starts with @racket[else] must be the last +@racket[cond-clause]. -If no @scheme[cond-clause]s are present, the result is @|void-const|. +If no @racket[cond-clause]s are present, the result is @|void-const|. -If only a @scheme[[else then-expr ...+]] is present, then the -@scheme[then-expr]s are evaluated. The results from all but the last -@scheme[then-expr] are ignored. The results of the last -@scheme[then-expr], which is in tail position with respect to the -@scheme[cond] form, are the results for the whole @scheme[cond] +If only a @racket[[else then-expr ...+]] is present, then the +@racket[then-expr]s are evaluated. The results from all but the last +@racket[then-expr] are ignored. The results of the last +@racket[then-expr], which is in tail position with respect to the +@racket[cond] form, are the results for the whole @racket[cond] form. -Otherwise, the first @scheme[test-expr] is evaluated. If it produces -@scheme[#f], then the result is the same as a @scheme[cond] form with -the remaining @scheme[cond-clause]s, in tail position with respect to -the original @scheme[cond] form. Otherwise, evaluation depends on the -form of the @scheme[cond-clause]: +Otherwise, the first @racket[test-expr] is evaluated. If it produces +@racket[#f], then the result is the same as a @racket[cond] form with +the remaining @racket[cond-clause]s, in tail position with respect to +the original @racket[cond] form. Otherwise, evaluation depends on the +form of the @racket[cond-clause]: -@specsubform[[test-expr then-expr ...+]]{The @scheme[then-expr]s are +@specsubform[[test-expr then-expr ...+]]{The @racket[then-expr]s are evaluated in order, and the results from all but the last -@scheme[then-expr] are ignored. The results of the last -@scheme[then-expr], which is in tail position with respect to the -@scheme[cond] form, provides the result for the whole @scheme[cond] +@racket[then-expr] are ignored. The results of the last +@racket[then-expr], which is in tail position with respect to the +@racket[cond] form, provides the result for the whole @racket[cond] form.} -@specsubform[#:literals (=>) [test-expr => proc-expr]]{The @scheme[proc-expr] is +@specsubform[#:literals (=>) [test-expr => proc-expr]]{The @racket[proc-expr] is evaluated, and it must produce a procedure that accepts on argument, otherwise the @exnraise[exn:fail:contract]. The procedure is applied -to the result of @scheme[test-expr] in tail position with respect to -the @scheme[cond] expression.} +to the result of @racket[test-expr] in tail position with respect to +the @racket[cond] expression.} -@specsubform[[test-expr]]{The result of the @scheme[test-expr] is -returned as the result of the @scheme[cond] form. The -@scheme[test-expr] is not in tail position.} +@specsubform[[test-expr]]{The result of the @racket[test-expr] is +returned as the result of the @racket[cond] form. The +@racket[test-expr] is not in tail position.} @mz-examples[ (cond) @@ -1791,31 +1786,31 @@ returned as the result of the @scheme[cond] form. The @defidform[else]{ -Recognized specially within forms like @scheme[cond]. An -@scheme[else] form as an expression is a syntax error.} +Recognized specially within forms like @racket[cond]. An +@racket[else] form as an expression is a syntax error.} @defidform[=>]{ -Recognized specially within forms like @scheme[cond]. A -@scheme[=>] form as an expression is a syntax error.} +Recognized specially within forms like @racket[cond]. A +@racket[=>] form as an expression is a syntax error.} @defform[(and expr ...)]{ -@guideintro["and+or"]{@scheme[and]} +@guideintro["and+or"]{@racket[and]} -If no @scheme[expr]s are provided, then result is @scheme[#t]. +If no @racket[expr]s are provided, then result is @racket[#t]. -If a single @scheme[expr] is provided, then it is in tail position, so -the results of the @scheme[and] expression are the results of the -@scheme[expr]. +If a single @racket[expr] is provided, then it is in tail position, so +the results of the @racket[and] expression are the results of the +@racket[expr]. -Otherwise, the first @scheme[expr] is evaluated. If it produces -@scheme[#f], the result of the @scheme[and] expression is -@scheme[#f]. Otherwise, the result is the same as an @scheme[and] -expression with the remaining @scheme[expr]s in tail position with -respect to the original @scheme[and] form. +Otherwise, the first @racket[expr] is evaluated. If it produces +@racket[#f], the result of the @racket[and] expression is +@racket[#f]. Otherwise, the result is the same as an @racket[and] +expression with the remaining @racket[expr]s in tail position with +respect to the original @racket[and] form. @mz-examples[ (and) @@ -1827,19 +1822,19 @@ respect to the original @scheme[and] form. @defform[(or expr ...)]{ -@guideintro["and+or"]{@scheme[or]} +@guideintro["and+or"]{@racket[or]} -If no @scheme[expr]s are provided, then result is @scheme[#f]. +If no @racket[expr]s are provided, then result is @racket[#f]. -If a single @scheme[expr] is provided, then it is in tail position, so -the results of the @scheme[and] expression are the results of the -@scheme[expr]. +If a single @racket[expr] is provided, then it is in tail position, so +the results of the @racket[and] expression are the results of the +@racket[expr]. -Otherwise, the first @scheme[expr] is evaluated. If it produces a -value other than @scheme[#f], that result is the result of the -@scheme[or] expression. Otherwise, the result is the same as an -@scheme[or] expression with the remaining @scheme[expr]s in tail -position with respect to the original @scheme[or] form. +Otherwise, the first @racket[expr] is evaluated. If it produces a +value other than @racket[#f], that result is the result of the +@racket[or] expression. Otherwise, the result is the same as an +@racket[or] expression with the remaining @racket[expr]s in tail +position with respect to the original @racket[or] form. @mz-examples[ (or) @@ -1850,27 +1845,27 @@ position with respect to the original @scheme[or] form. ]} @;------------------------------------------------------------------------ -@section[#:tag "case"]{Dispatch: @scheme[case]} +@section[#:tag "case"]{Dispatch: @racket[case]} @defform/subs[#:literals (else) (case val-expr case-clause ...) ([case-clause [(datum ...) then-expr ...+] [else then-expr ...+]])]{ -Evaluates @scheme[val-expr] and uses the result to select a -@scheme[case-clause]. The selected clause is the first one with a -@scheme[datum] whose @scheme[quote]d form is @scheme[eqv?] to the -result of @scheme[val-expr]. If no such @scheme[datum] is present, the -@scheme[else] @scheme[case-clause] is selected; if no @scheme[else] -@scheme[case-clause] is present, either, then the result of the -@scheme[case] form is @|void-const|. +Evaluates @racket[val-expr] and uses the result to select a +@racket[case-clause]. The selected clause is the first one with a +@racket[datum] whose @racket[quote]d form is @racket[eqv?] to the +result of @racket[val-expr]. If no such @racket[datum] is present, the +@racket[else] @racket[case-clause] is selected; if no @racket[else] +@racket[case-clause] is present, either, then the result of the +@racket[case] form is @|void-const|. -For the selected @scheme[case-clause], the results of the last -@scheme[then-expr], which is in tail position with respect to the -@scheme[case] form, are the results for the whole @scheme[case] form. +For the selected @racket[case-clause], the results of the last +@racket[then-expr], which is in tail position with respect to the +@racket[case] form, are the results for the whole @racket[case] form. -A @scheme[case-clause] that starts with @scheme[else] must be the last -@scheme[case-clause]. +A @racket[case-clause] that starts with @racket[else] must be the last +@racket[case-clause]. @mz-examples[ (case (+ 7 5) @@ -1892,7 +1887,7 @@ A @scheme[case-clause] that starts with @scheme[else] must be the last ]} @;------------------------------------------------------------------------ -@section[#:tag "define"]{Definitions: @scheme[define], @scheme[define-syntax], ...} +@section[#:tag "define"]{Definitions: @racket[define], @racket[define-syntax], ...} @guideintro["define"]{definitions} @@ -1901,27 +1896,27 @@ A @scheme[case-clause] that starts with @scheme[else] must be the last ([head id (head args)] [args (code:line arg ...) - (code:line arg ... @#,schemeparenfont{.} rest-id)] + (code:line arg ... @#,racketparenfont{.} rest-id)] [arg arg-id [arg-id default-expr] (code:line keyword arg-id) (code:line keyword [arg-id default-expr])])]{ -The first form @tech{bind}s @scheme[id] to the result of -@scheme[expr], and the second form @tech{bind}s @scheme[id] to a -procedure. In the second case, the generation procedure is -@scheme[(#,cvt (head args) body ...+)], using the @|cvt| meta-function +The first form @tech{bind}s @racket[id] to the result of +@racket[expr], and the second form @tech{bind}s @racket[id] to a +procedure. In the second case, the generated procedure is +@racket[(#,cvt (head args) body ...+)], using the @|cvt| meta-function defined as follows: -@schemeblock[ +@racketblock[ (#,cvt (id . _kw-formals) . _datum) = (lambda _kw-formals . _datum) (#,cvt (head . _kw-formals) . _datum) = (lambda _kw-formals expr) @#,elem{if} (#,cvt head . _datum) = expr ] -At the top level, the top-level binding @scheme[id] is created after -evaluating @scheme[expr], if it does not exist already, and the -top-level mapping of @scheme[id] (in the @techlink{namespace} linked +At the top level, the top-level binding @racket[id] is created after +evaluating @racket[expr], if it does not exist already, and the +top-level mapping of @racket[id] (in the @techlink{namespace} linked with the compiled definition) is set to the binding at the same time. @defexamples[ @@ -1944,14 +1939,14 @@ x @defform[(define-values (id ...) expr)]{ -Evaluates the @scheme[expr], and @tech{bind}s the results to the -@scheme[id]s, in order, if the number of results matches the number of -@scheme[id]s; if @scheme[expr] produces a different number of results, +Evaluates the @racket[expr], and @tech{bind}s the results to the +@racket[id]s, in order, if the number of results matches the number of +@racket[id]s; if @racket[expr] produces a different number of results, the @exnraise[exn:fail:contract]. -At the top level, the top-level binding for each @scheme[id] is -created after evaluating @scheme[expr], if it does not exist already, -and the top-level mapping of each @scheme[id] (in the +At the top level, the top-level binding for each @racket[id] is +created after evaluating @racket[expr], if it does not exist already, +and the top-level mapping of each @racket[id] (in the @techlink{namespace} linked with the compiled definition) is set to the binding at the same time. @@ -1967,16 +1962,16 @@ z (define-syntax (head args) body ...+)]]{ The first form creates a @tech{transformer binding} (see -@secref["transformer-model"]) of @scheme[id] with the value of -@scheme[expr], which is an expression at @tech{phase level} 1 relative +@secref["transformer-model"]) of @racket[id] with the value of +@racket[expr], which is an expression at @tech{phase level} 1 relative to the surrounding context. (See @secref["id-model"] for information -on @tech{phase levels}.) Evaluation of @scheme[expr] side is -@scheme[parameterize]d to set @scheme[current-namespace] as in -@scheme[let-syntax]. +on @tech{phase levels}.) Evaluation of @racket[expr] side is +@racket[parameterize]d to set @racket[current-namespace] as in +@racket[let-syntax]. -The second form is a shorthand the same as for @scheme[define]; it -expands to a definition of the first form where the @scheme[expr] is a -@scheme[lambda] form.} +The second form is a shorthand the same as for @racket[define]; it +expands to a definition of the first form where the @racket[expr] is a +@racket[lambda] form.} @defexamples[#:eval (syntax-eval) (define-syntax foo @@ -1996,14 +1991,14 @@ expands to a definition of the first form where the @scheme[expr] is a @defform[(define-syntaxes (id ...) expr)]{ -Like @scheme[define-syntax], but creates a @tech{transformer binding} -for each @scheme[id]. The @scheme[expr] should produce as many values -as @scheme[id]s, and each value is bound to the corresponding -@scheme[id]. +Like @racket[define-syntax], but creates a @tech{transformer binding} +for each @racket[id]. The @racket[expr] should produce as many values +as @racket[id]s, and each value is bound to the corresponding +@racket[id]. -When @scheme[expr] produces zero values for a top-level -@scheme[define-syntaxes] (i.e., not in a module or internal-definition -position), then the @scheme[id]s are effectively declared without +When @racket[expr] produces zero values for a top-level +@racket[define-syntaxes] (i.e., not in a module or internal-definition +position), then the @racket[id]s are effectively declared without binding; see @secref["macro-introduced-bindings"]. @defexamples[#:eval (syntax-eval) @@ -2028,12 +2023,12 @@ binding; see @secref["macro-introduced-bindings"]. @defform*[[(define-for-syntax id expr) (define-for-syntax (head args) body ...+)]]{ -Like @scheme[define], except that the binding is at @tech{phase level} +Like @racket[define], except that the binding is at @tech{phase level} 1 instead of @tech{phase level} 0 relative to its context. The expression for the binding is also at @tech{phase level} 1. (See @secref["id-model"] for information on @tech{phase levels}.) -Evaluation of @scheme[expr] side is @scheme[parameterize]d to set -@scheme[current-namespace] as in @scheme[let-syntax].} +Evaluation of @racket[expr] side is @racket[parameterize]d to set +@racket[current-namespace] as in @racket[let-syntax].} @defexamples[#:eval (syntax-eval) (define-for-syntax helper 2) @@ -2057,8 +2052,8 @@ helper @defform[(define-values-for-syntax (id ...) expr)]{ -Like @scheme[define-for-syntax], but @scheme[expr] must produce as -many values as supplied @scheme[id]s, and all of the @scheme[id]s are +Like @racket[define-for-syntax], but @racket[expr] must produce as +many values as supplied @racket[id]s, and all of the @racket[id]s are bound (at @tech{phase level} 1).} @defexamples[#:eval (syntax-eval) @@ -2071,66 +2066,66 @@ bound (at @tech{phase level} 1).} @; ---------------------------------------------------------------------- -@subsection[#:tag "require-syntax"]{@scheme[require] Macros} +@subsection[#:tag "require-syntax"]{@racket[require] Macros} @note-lib-only[racket/require-syntax] @defform*[[(define-require-syntax id expr) (define-require-syntax (id args ...) body ...+)]]{ -The first form is like @scheme[define-syntax], but for a -@scheme[require] sub-form. The @scheme[proc-expr] must produce a +The first form is like @racket[define-syntax], but for a +@racket[require] sub-form. The @racket[proc-expr] must produce a procedure that accepts and returns a syntax object representing a -@scheme[require] sub-form. +@racket[require] sub-form. -This form expands to @scheme[define-syntax] with a use of -@scheme[make-require-transformer]; see @secref["require-trans"] for +This form expands to @racket[define-syntax] with a use of +@racket[make-require-transformer]; see @secref["require-trans"] for more information. -The second form is a shorthand the same as for @scheme[define-syntax]; it -expands to a definition of the first form where the @scheme[expr] is a -@scheme[lambda] form.} +The second form is a shorthand the same as for @racket[define-syntax]; it +expands to a definition of the first form where the @racket[expr] is a +@racket[lambda] form.} @; ---------------------------------------------------------------------- -@subsection[#:tag "provide-syntax"]{@scheme[provide] Macros} +@subsection[#:tag "provide-syntax"]{@racket[provide] Macros} @note-lib-only[racket/provide-syntax] @defform*[[(define-provide-syntax id expr) (define-provide-syntax (id args ...) body ...+)]]{ -The first form is like @scheme[define-syntax], but for a -@scheme[provide] sub-form. The @scheme[proc-expr] must produce a +The first form is like @racket[define-syntax], but for a +@racket[provide] sub-form. The @racket[proc-expr] must produce a procedure that accepts and returns a syntax object representing a -@scheme[provide] sub-form. +@racket[provide] sub-form. -This form expands to @scheme[define-syntax] with a use of -@scheme[make-provide-transformer]; see @secref["provide-trans"] for +This form expands to @racket[define-syntax] with a use of +@racket[make-provide-transformer]; see @secref["provide-trans"] for more information. -The second form is a shorthand the same as for @scheme[define-syntax]; it -expands to a definition of the first form where the @scheme[expr] is a -@scheme[lambda] form.} +The second form is a shorthand the same as for @racket[define-syntax]; it +expands to a definition of the first form where the @racket[expr] is a +@racket[lambda] form.} @;------------------------------------------------------------------------ -@section[#:tag "begin"]{Sequencing: @scheme[begin], @scheme[begin0], and @scheme[begin-for-syntax]} +@section[#:tag "begin"]{Sequencing: @racket[begin], @racket[begin0], and @racket[begin-for-syntax]} -@guideintro["begin"]{@scheme[begin] and @scheme[begin0]} +@guideintro["begin"]{@racket[begin] and @racket[begin0]} @defform*[[(begin form ...) (begin expr ...+)]]{ -The first form applies when @scheme[begin] appears at the top level, +The first form applies when @racket[begin] appears at the top level, at module level, or in an internal-definition position (before any expression in the internal-definition sequence). In that case, the -@scheme[begin] form is equivalent to splicing the @scheme[form]s into +@racket[begin] form is equivalent to splicing the @racket[form]s into the enclosing context. -The second form applies for @scheme[begin] in an expression position. -In that case, the @scheme[expr]s are evaluated in order, and the -results are ignored for all but the last @scheme[expr]. The last -@scheme[expr] is in tail position with respect to the @scheme[begin] +The second form applies for @racket[begin] in an expression position. +In that case, the @racket[expr]s are evaluated in order, and the +results are ignored for all but the last @racket[expr]. The last +@racket[expr] is in tail position with respect to the @racket[begin] form. @examples[ @@ -2148,10 +2143,10 @@ form. @defform[(begin0 expr body ...+)]{ -Evaluates the @scheme[expr], then evaluates the @scheme[body]s, -ignoring the @scheme[body] results. The results of the @scheme[expr] -are the results of the @scheme[begin0] form, but the @scheme[expr] is -in tail position only if no @scheme[body]s are present. +Evaluates the @racket[expr], then evaluates the @racket[body]s, +ignoring the @racket[body] results. The results of the @racket[expr] +are the results of the @racket[begin0] form, but the @racket[expr] is +in tail position only if no @racket[body]s are present. @mz-examples[ (begin0 @@ -2162,20 +2157,20 @@ in tail position only if no @scheme[body]s are present. @defform[(begin-for-syntax form ...)]{ Allowed only in a @tech{top-level context} or @tech{module context}. -Each @scheme[form] is partially expanded (see +Each @racket[form] is partially expanded (see @secref["partial-expansion"]) to determine one of the following classifications: @itemize[ - @item{@scheme[define] or @scheme[define-values] form: converted to - a @scheme[define-values-for-syntax] form.} + @item{@racket[define] or @racket[define-values] form: converted to + a @racket[define-values-for-syntax] form.} - @item{@scheme[require] form: content is wrapped with - @scheme[for-syntax].} + @item{@racket[require] form: content is wrapped with + @racket[for-syntax].} - @item{expression form @scheme[_expr]: converted to - @scheme[(define-values-for-syntax () (begin _expr (values)))], which + @item{expression form @racket[_expr]: converted to + @racket[(define-values-for-syntax () (begin _expr (values)))], which effectively evaluates the expression at expansion time and, in the case of a @tech{module context}, preserves the expression for future @tech{visit}s of the module.} @@ -2185,17 +2180,17 @@ classifications: } @;------------------------------------------------------------------------ -@section[#:tag "when+unless"]{Guarded Evaluation: @scheme[when] and @scheme[unless]} +@section[#:tag "when+unless"]{Guarded Evaluation: @racket[when] and @racket[unless]} -@guideintro["when+unless"]{@scheme[when] and @scheme[unless]} +@guideintro["when+unless"]{@racket[when] and @racket[unless]} @defform[(when test-expr expr ...)]{ -Evaluates the @scheme[text-expr]. If the result is @scheme[#f], then -the result of the @scheme[when] expression is -@|void-const|. Otherwise, the @scheme[expr]s are evaluated, and the -last @scheme[expr] is in tail position with respect to the -@scheme[when] form. +Evaluates @racket[test-expr]. If the result is @racket[#f], then +the result of the @racket[when] expression is +@|void-const|. Otherwise, the @racket[expr]s are evaluated, and the +last @racket[expr] is in tail position with respect to the +@racket[when] form. @mz-examples[ (when (positive? -5) @@ -2207,7 +2202,7 @@ last @scheme[expr] is in tail position with respect to the @defform[(unless test-expr expr ...)]{ -Equivalent to @scheme[(when (not test-expr) expr ...)]. +Equivalent to @racket[(when (not test-expr) expr ...)]. @mz-examples[ (unless (positive? 5) @@ -2218,34 +2213,34 @@ Equivalent to @scheme[(when (not test-expr) expr ...)]. ]} @;------------------------------------------------------------------------ -@section[#:tag "set!"]{Assignment: @scheme[set!] and @scheme[set!-values]} +@section[#:tag "set!"]{Assignment: @racket[set!] and @racket[set!-values]} -@guideintro["set!"]{@scheme[set!]} +@guideintro["set!"]{@racket[set!]} @defform[(set! id expr)]{ -If @scheme[id] has a @tech{transformer binding} to an @tech{assignment -transformer}, as produced by @scheme[make-set!-transformer] or as an -instance of a structure type with the @scheme[prop:set!-transformer] +If @racket[id] has a @tech{transformer binding} to an @tech{assignment +transformer}, as produced by @racket[make-set!-transformer] or as an +instance of a structure type with the @racket[prop:set!-transformer] property, then this form is expanded by calling the assignment -transformer with the full expressions. If @scheme[id] has a +transformer with the full expressions. If @racket[id] has a @tech{transformer binding} to a @tech{rename transformer} as produced -by @scheme[make-rename-transformer] or as an instance of a structure -type with the @scheme[prop:rename-transformer] property, then this -form is expanded by replacing @scheme[id] with the target identifier -(e.g., the one provided to @scheme[make-rename-transformer]). If a -transformer binding has both @scheme[prop:set!-transformer] ad -@scheme[prop:rename-transformer] properties, the latter takes +by @racket[make-rename-transformer] or as an instance of a structure +type with the @racket[prop:rename-transformer] property, then this +form is expanded by replacing @racket[id] with the target identifier +(e.g., the one provided to @racket[make-rename-transformer]). If a +transformer binding has both @racket[prop:set!-transformer] ad +@racket[prop:rename-transformer] properties, the latter takes precedence. -Otherwise, evaluates @scheme[expr] and installs the result into the -location for @scheme[id], which must be bound as a local variable or +Otherwise, evaluates @racket[expr] and installs the result into the +location for @racket[id], which must be bound as a local variable or defined as a @tech{top-level variable} or @tech{module-level -variable}. If @scheme[id] refers to an imported binding, a syntax -error is reported. If @scheme[id] refers to a @tech{top-level +variable}. If @racket[id] refers to an imported binding, a syntax +error is reported. If @racket[id] refers to a @tech{top-level variable} that has not been defined, the @exnraise[exn:fail:contract]. -See also @scheme[compile-allow-set!-undefined]. +See also @racket[compile-allow-set!-undefined]. @defexamples[ (define x 12) @@ -2259,11 +2254,11 @@ x @defform[(set!-values (id ...) expr)]{ -Assuming that all @scheme[id]s refer to variables, this form evaluates -@scheme[expr], which must produce as many values as supplied -@scheme[id]s. The location of each @scheme[id] is filled wih to the -corresponding value from @scheme[expr] in the same way as for -@scheme[set!]. +Assuming that all @racket[id]s refer to variables, this form evaluates +@racket[expr], which must produce as many values as supplied +@racket[id]s. The location of each @racket[id] is filled wih to the +corresponding value from @racket[expr] in the same way as for +@racket[set!]. @mz-examples[ (let ([a 1] @@ -2272,75 +2267,75 @@ corresponding value from @scheme[expr] in the same way as for (list a b)) ] -More generally, the @scheme[set!-values] form is expanded to +More generally, the @racket[set!-values] form is expanded to -@schemeblock[ +@racketblock[ (let-values ([(_tmp-id ...) expr]) (set! id _tmp-id) ...) ] -which triggers further expansion if any @scheme[id] has a transformer +which triggers further expansion if any @racket[id] has a transformer binding to an @tech{assignment transformer}.} @;------------------------------------------------------------------------ @include-section["for.scrbl"] @;------------------------------------------------------------------------ -@section[#:tag "wcm"]{Continuation Marks: @scheme[with-continuation-mark]} +@section[#:tag "wcm"]{Continuation Marks: @racket[with-continuation-mark]} @defform[(with-continuation-mark key-expr val-expr result-expr)]{ -The @scheme[key-expr], @scheme[mark-expr], and @scheme[result-expr] -expressions are evaluated in order. After @scheme[key-expr] is -evaluated to obtain a key and @scheme[mark-expr] is evaluated to +The @racket[key-expr], @racket[mark-expr], and @racket[result-expr] +expressions are evaluated in order. After @racket[key-expr] is +evaluated to obtain a key and @racket[mark-expr] is evaluated to obtain a mark, the key is mapped to the mark in the current continuation's initial frame. If the frame already has a mark for the -key, it is replaced. Finally, the @scheme[result-expr] is evaluated; -the continuation for evaluating @scheme[result-expr] is the -continuation of the @scheme[with-continuation-mark] expression (so the -result of the @scheme[result-expr] is the result of the -@scheme[with-continuation-mark] expression, and @scheme[result-expr] -is in tail position for the @scheme[with-continuation-mark] +key, it is replaced. Finally, the @racket[result-expr] is evaluated; +the continuation for evaluating @racket[result-expr] is the +continuation of the @racket[with-continuation-mark] expression (so the +result of the @racket[result-expr] is the result of the +@racket[with-continuation-mark] expression, and @racket[result-expr] +is in tail position for the @racket[with-continuation-mark] expression). @moreref["contmarks"]{continuation marks}} @;------------------------------------------------------------------------ -@section[#:tag "quasiquote"]{Quasiquoting: @scheme[quasiquote], @scheme[unquote], and @scheme[unquote-splicing]} +@section[#:tag "quasiquote"]{Quasiquoting: @racket[quasiquote], @racket[unquote], and @racket[unquote-splicing]} @defform[(quasiquote datum)]{ -The same as @scheme[(quote datum)] if @scheme[datum] does not include -@scheme[(#,unquote-id _expr)] or @scheme[(#,unquote-splicing-id _expr)]. An -@scheme[(#,unquote-id _expr)] form escapes from the quote, however, -and the result of the @scheme[_expr] takes the place of the -@scheme[(#,unquote-id _expr)] form in the @scheme[quasiquote] result. An -@scheme[(#,unquote-splicing-id _expr)] similarly escapes, but the -@scheme[_expr] must produce a list, and its elements are spliced as -multiple values place of the @scheme[(#,unquote-splicing-id _expr)], which -must appear as the @scheme[car] or a quoted pair, as an element of a +The same as @racket[(quote datum)] if @racket[datum] does not include +@racket[(#,unquote-id _expr)] or @racket[(#,unquote-splicing-id _expr)]. An +@racket[(#,unquote-id _expr)] form escapes from the quote, however, +and the result of the @racket[_expr] takes the place of the +@racket[(#,unquote-id _expr)] form in the @racket[quasiquote] result. An +@racket[(#,unquote-splicing-id _expr)] similarly escapes, but the +@racket[_expr] must produce a list, and its elements are spliced as +multiple values place of the @racket[(#,unquote-splicing-id _expr)], which +must appear as the @racket[car] or a quoted pair, as an element of a quoted vector, or as an element of a quoted @tech{prefab} structure; -in the case of a pair, if the @scheme[cdr] of the relevant quoted pair -is empty, then @scheme[_expr] need not produce a list, and its result +in the case of a pair, if the @racket[cdr] of the relevant quoted pair +is empty, then @racket[_expr] need not produce a list, and its result is used directly in place of the quoted pair (in the same way that -@scheme[append] accepts a non-list final argument). In a quoted -@tech{hash table}, an @scheme[(#,unquote-id _expr)] or -@scheme[(#,unquote-splicing-id _expr)] expression escapes only in the +@racket[append] accepts a non-list final argument). In a quoted +@tech{hash table}, an @racket[(#,unquote-id _expr)] or +@racket[(#,unquote-splicing-id _expr)] expression escapes only in the second element of an entry pair (i.e., the value), while entry keys -are always implicitly quoted. If @scheme[unquote] or -@scheme[unquote-splicing] appears within @scheme[quasiquote] in any -other way than as @scheme[(#,unquote-id _expr)] or -@scheme[(#,unquote-splicing-id _expr)], a syntax error is reported. +are always implicitly quoted. If @racket[unquote] or +@racket[unquote-splicing] appears within @racket[quasiquote] in any +other way than as @racket[(#,unquote-id _expr)] or +@racket[(#,unquote-splicing-id _expr)], a syntax error is reported. @mz-examples[ -(eval:alts (#,(scheme quasiquote) (0 1 2)) `(0 1 2)) -(eval:alts (#,(scheme quasiquote) (0 (#,unquote-id (+ 1 2)) 4)) `(0 ,(+ 1 2) 4)) -(eval:alts (#,(scheme quasiquote) (0 (#,unquote-splicing-id (list 1 2)) 4)) `(0 ,@(list 1 2) 4)) -(eval:alts (#,(scheme quasiquote) (0 (#,unquote-splicing-id 1) 4)) `(0 ,@1 4)) -(eval:alts (#,(scheme quasiquote) (0 (#,unquote-splicing-id 1))) `(0 ,@1)) +(eval:alts (#,(racket quasiquote) (0 1 2)) `(0 1 2)) +(eval:alts (#,(racket quasiquote) (0 (#,unquote-id (+ 1 2)) 4)) `(0 ,(+ 1 2) 4)) +(eval:alts (#,(racket quasiquote) (0 (#,unquote-splicing-id (list 1 2)) 4)) `(0 ,@(list 1 2) 4)) +(eval:alts (#,(racket quasiquote) (0 (#,unquote-splicing-id 1) 4)) `(0 ,@1 4)) +(eval:alts (#,(racket quasiquote) (0 (#,unquote-splicing-id 1))) `(0 ,@1)) ] -A @scheme[quasiquote], @scheme[unquote], or @scheme[unquote-splicing] +A @racket[quasiquote], @racket[unquote], or @racket[unquote-splicing] form is typically abbreviated with @litchar{`}, @litchar{,}, or @litchar[",@"], respectively. See also @secref["parse-quote"]. @@ -2348,55 +2343,55 @@ form is typically abbreviated with @litchar{`}, @litchar{,}, or `(0 1 2) `(1 ,(+ 1 2) 4) `#s(stuff 1 ,(+ 1 2) 4) -(eval:alts #,(schemefont (schemevalfont "`#hash((\"a\" . ") "," (scheme (+ 1 2)) (schemevalfont "))")) #hash(("a" . 3))) +(eval:alts #,(racketfont (racketvalfont "`#hash((\"a\" . ") "," (racket (+ 1 2)) (racketvalfont "))")) #hash(("a" . 3))) `#hash((,(+ 1 2) . "a")) `(1 ,@(list 1 2) 4) `#(1 ,@(list 1 2) 4) ] -A @scheme[quasiquote] form within the original @scheme[datum] -increments the level of quasiquotation: within the @scheme[quasiquote] -form, each @scheme[unquote] or @scheme[unquote-splicing] is preserved, -but a further nested @scheme[unquote] or @scheme[unquote-splicing] -escapes. Multiple nestings of @scheme[quasiquote] require multiple -nestings of @scheme[unquote] or @scheme[unquote-splicing] to escape. +A @racket[quasiquote] form within the original @racket[datum] +increments the level of quasiquotation: within the @racket[quasiquote] +form, each @racket[unquote] or @racket[unquote-splicing] is preserved, +but a further nested @racket[unquote] or @racket[unquote-splicing] +escapes. Multiple nestings of @racket[quasiquote] require multiple +nestings of @racket[unquote] or @racket[unquote-splicing] to escape. @mz-examples[ `(1 `,(+ 1 ,(+ 2 3)) 4) `(1 ```,,@,,@(list (+ 1 2)) 4) ] -The @scheme[quasiquote] form allocates only as many fresh cons cells, -vectors, and boxes as are needed without analyzing @scheme[unquote] -and @scheme[unquote-splicing] expressions. For example, in +The @racket[quasiquote] form allocates only as many fresh cons cells, +vectors, and boxes as are needed without analyzing @racket[unquote] +and @racket[unquote-splicing] expressions. For example, in -@schemeblock[ +@racketblock[ `(,1 2 3) ] -a single tail @scheme['(2 3)] is used for every evaluation of the -@scheme[quasiquote] expression. +a single tail @racket['(2 3)] is used for every evaluation of the +@racket[quasiquote] expression. } @defidform[unquote]{ -See @scheme[quasiquote], where @scheme[unquote] is recognized as an -escape. An @scheme[unquote] form as an expression is a syntax error.} +See @racket[quasiquote], where @racket[unquote] is recognized as an +escape. An @racket[unquote] form as an expression is a syntax error.} @defidform[unquote-splicing]{ -See @scheme[quasiquote], where @scheme[unquote-splicing] is recognized as an -escape. An @scheme[unquote-splicing] form as an expression is a syntax error.} +See @racket[quasiquote], where @racket[unquote-splicing] is recognized as an +escape. An @racket[unquote-splicing] form as an expression is a syntax error.} @;------------------------------------------------------------------------ -@section{Syntax Quoting: @scheme[quote-syntax]} +@section{Syntax Quoting: @racket[quote-syntax]} @defform[(quote-syntax datum)]{ Produces a @tech{syntax object} that preserves the @tech{lexical information} and source-location information attached to -@scheme[datum] at expansion time. +@racket[datum] at expansion time. @mz-examples[ (syntax? (quote-syntax x)) @@ -2404,33 +2399,33 @@ information} and source-location information attached to } @;------------------------------------------------------------------------ -@section[#:tag "#%top-interaction"]{Interaction Wrapper: @scheme[#%top-interaction]} +@section[#:tag "#%top-interaction"]{Interaction Wrapper: @racket[#%top-interaction]} @defform[(#%top-interaction . form)]{ -Expands to simply @scheme[form]. The @scheme[#%top-interaction] form -is similar to @scheme[#%app] and @scheme[#%module-begin], in that it +Expands to simply @racket[form]. The @racket[#%top-interaction] form +is similar to @racket[#%app] and @racket[#%module-begin], in that it provides a hook to control interactive evaluation through -@scheme[load] (more precisely, the default @tech{load handler}) or -@scheme[read-eval-print-loop].} +@racket[load] (more precisely, the default @tech{load handler}) or +@racket[read-eval-print-loop].} @;------------------------------------------------------------------------ @include-section["package.scrbl"] @;------------------------------------------------------------------------ -@section[#:tag "nest"]{Flattening Syntactic Sequences: @scheme[nest]} +@section[#:tag "nest"]{Flattening Syntactic Sequences: @racket[nest]} @note-lib[racket/nest] @defform[(nest ([datum ...+] ...) body ...+)]{ Combines nested expressions that syntactically drift to the right into -a more linear textual format, much in the same way that @scheme[let*] -linearizes a sequence of nested @scheme[let] expressions. +a more linear textual format, much in the same way that @racket[let*] +linearizes a sequence of nested @racket[let] expressions. For example, -@schemeblock[ +@racketblock[ (nest ([let ([x 10] [y 6])] [with-handlers ([exn:fail? (lambda (x) 15)])] @@ -2441,7 +2436,7 @@ For example, is equivalent to -@schemeblock[ +@racketblock[ (let ([x 10] [y 6]) (with-handlers ([exn:fail? (lambda (x) 15)]) @@ -2450,11 +2445,11 @@ is equivalent to (display (+ d r)))))) ] -The @scheme[nest] form is unusual in that it has no semantics apart +The @racket[nest] form is unusual in that it has no semantics apart from its expansion, and its implementation is easier to understand than a precise prose description: -@schemeblock[ +@racketblock[ (define-syntax nest (syntax-rules () [(nest () body0 body ...) From 12b95ece4c332d0de8e5e487c878ed0fa417b40b Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 23 Apr 2010 08:11:56 -0600 Subject: [PATCH 02/12] decent Scribble rendering of hash tables --- collects/scribble/racket.ss | 229 +++++++++++++++++++++++------------- 1 file changed, 147 insertions(+), 82 deletions(-) diff --git a/collects/scribble/racket.ss b/collects/scribble/racket.ss index 977a38e7cd..57144a7a99 100644 --- a/collects/scribble/racket.ss +++ b/collects/scribble/racket.ss @@ -489,6 +489,7 @@ => (lambda (converted) ((loop init-line! quote-depth qq?) converted))] [(or (pair? (syntax-e c)) + (forced-pair? (syntax-e c)) (null? (syntax-e c)) (vector? (syntax-e c)) (and (struct? (syntax-e c)) @@ -513,85 +514,92 @@ (to-quoted "`" qq? quote-depth out color? inc-src-col))]) (when (vector? (syntax-e c)) (let ([vec (syntax-e c)]) - (out "#" #;(format "#~a" (vector-length vec)) p-color) + (out "#" #; (format "#~a" (vector-length vec)) p-color) (if (zero? (vector-length vec)) (set! src-col (+ src-col (- (syntax-span c) 2))) (set! src-col (+ src-col (- (syntax-column (vector-ref vec 0)) (syntax-column c) - 1)))))) - (when (struct? (syntax-e c)) - (out "#s" p-color) - (set! src-col (+ src-col 2))) - (out (case sh - [(#\[ #\?) "["] - [(#\{) "{"] - [else "("]) - p-color) - (set! src-col (+ src-col 1)) - (hash-set! next-col-map src-col dest-col) - (let lloop ([l (cond - [(vector? (syntax-e c)) + 1))))))) + (when (struct? (syntax-e c)) + (out "#s" p-color) + (set! src-col (+ src-col 2))) + (out (case sh + [(#\[ #\?) "["] + [(#\{) "{"] + [else "("]) + p-color) + (set! src-col (+ src-col 1)) + (hash-set! next-col-map src-col dest-col) + (let lloop ([l (cond + [(vector? (syntax-e c)) (vector->short-list (syntax-e c) syntax-e)] - [(struct? (syntax-e c)) - (let ([l (vector->list (struct->vector (syntax-e c)))]) - ;; Need to build key datum, syntax-ize it internally, and - ;; set the overall width to fit right: - (cons (let ([key (syntax-ize (prefab-struct-key (syntax-e c)) - (+ 3 (or (syntax-column c) 0)) - (or (syntax-line c) 1))] - [end (if (pair? (cdr l)) - (and (equal? (syntax-line c) (syntax-line (cadr l))) - (syntax-column (cadr l))) - (and (syntax-column c) - (+ (syntax-column c) (syntax-span c))))]) - (if end - (datum->syntax #f - (syntax-e key) - (vector #f (syntax-line key) - (syntax-column key) - (syntax-position key) - (- end 1 (syntax-column key)))) - end)) - (cdr l)))] - [(struct-proxy? (syntax-e c)) - (cons - (struct-proxy-name (syntax-e c)) - (struct-proxy-content (syntax-e c)))] - [else c])] - [first-qq? (and qq? (not (struct-proxy? (syntax-e c))))]) - (cond - [(and (syntax? l) - (pair? (syntax-e l)) - (not (and (memq (syntax-e (car (syntax-e l))) - '(quote unquote syntax unsyntax quasiquote quasiunsyntax)) - (let ([v (syntax->list l)]) - (and v (= 2 (length v)))) - (or (not qq?) - (quote-depth . > . 1) - (not (memq (syntax-e (car (syntax-e l))) - '(unquote unquote-splicing))))))) - (lloop (syntax-e l) first-qq?)] - [(or (null? l) - (and (syntax? l) - (null? (syntax-e l)))) - (void)] - [(pair? l) - ((loop init-line! quote-depth first-qq?) (car l)) - (lloop (cdr l) qq?)] - [else - (advance l init-line! -2) - (out ". " (if (positive? quote-depth) value-color paren-color)) - (set! src-col (+ src-col 3)) - (hash-set! next-col-map src-col dest-col) - ((loop init-line! quote-depth first-qq?) l)])) - (out (case sh - [(#\[ #\?) "]"] - [(#\{) "}"] - [else ")"]) - p-color) - (set! src-col (+ src-col 1)) - #; - (hash-set! next-col-map src-col dest-col)))] + [(struct? (syntax-e c)) + (let ([l (vector->list (struct->vector (syntax-e c)))]) + ;; Need to build key datum, syntax-ize it internally, and + ;; set the overall width to fit right: + (cons (let ([key (syntax-ize (prefab-struct-key (syntax-e c)) + (+ 3 (or (syntax-column c) 0)) + (or (syntax-line c) 1))] + [end (if (pair? (cdr l)) + (and (equal? (syntax-line c) (syntax-line (cadr l))) + (syntax-column (cadr l))) + (and (syntax-column c) + (+ (syntax-column c) (syntax-span c))))]) + (if end + (datum->syntax #f + (syntax-e key) + (vector #f (syntax-line key) + (syntax-column key) + (syntax-position key) + (- end 1 (syntax-column key)))) + end)) + (cdr l)))] + [(struct-proxy? (syntax-e c)) + (cons + (struct-proxy-name (syntax-e c)) + (struct-proxy-content (syntax-e c)))] + [(forced-pair? (syntax-e c)) + (syntax-e c)] + [else c])] + [first-qq? (and qq? (not (struct-proxy? (syntax-e c))))] + [dotted? #f]) + (cond + [(and (syntax? l) + (pair? (syntax-e l)) + (not dotted?) + (not (and (memq (syntax-e (car (syntax-e l))) + '(quote unquote syntax unsyntax quasiquote quasiunsyntax)) + (let ([v (syntax->list l)]) + (and v (= 2 (length v)))) + (or (not qq?) + (quote-depth . > . 1) + (not (memq (syntax-e (car (syntax-e l))) + '(unquote unquote-splicing))))))) + (lloop (syntax-e l) first-qq? #f)] + [(or (null? l) + (and (syntax? l) + (null? (syntax-e l)))) + (void)] + [(and (pair? l) (not dotted?)) + ((loop init-line! quote-depth first-qq?) (car l)) + (lloop (cdr l) qq? #f)] + [(forced-pair? l) + ((loop init-line! quote-depth first-qq?) (forced-pair-car l)) + (lloop (forced-pair-cdr l) qq? #t)] + [else + (advance l init-line! -2) + (out ". " (if (positive? quote-depth) value-color paren-color)) + (set! src-col (+ src-col 3)) + (hash-set! next-col-map src-col dest-col) + ((loop init-line! quote-depth first-qq?) l)])) + (out (case sh + [(#\[ #\?) "]"] + [(#\{) "}"] + [else ")"]) + p-color) + (set! src-col (+ src-col 1)) + #; + (hash-set! next-col-map src-col dest-col))] [(box? (syntax-e c)) (advance c init-line!) (let ([quote-depth (to-quoted "`" qq? quote-depth out color? inc-src-col)]) @@ -612,8 +620,32 @@ (set! src-col (+ src-col delta)) (hash-set! next-col-map src-col dest-col) ((loop init-line! (if qq? quote-depth +inf.0) qq?) - (syntax-ize (hash-map (syntax-e c) cons) - (+ (syntax-column c) delta))) + (let* ([l (sort (hash-map (syntax-e c) cons) + (lambda (a b) + (< (or (syntax-position (cdr a)) -inf.0) + (or (syntax-position (cdr b)) -inf.0))))] + [l2 (for/list ([p (in-list l)]) + (let* ([tentative (syntax-ize (car p) 0)] + [width (syntax-span tentative)]) + (datum->syntax + #f + (make-forced-pair + (syntax-ize (car p) + (max 0 (- (syntax-column (cdr p)) + width + 3)) + (syntax-line (cdr p))) + (cdr p)) + (vector 'here + (syntax-line (cdr p)) + (max 0 (- (syntax-column (cdr p)) width 4)) + (max 1 (- (syntax-position (cdr p)) width 4)) + (+ (syntax-span (cdr p)) width 5)))))]) + (datum->syntax #f l2 (vector (syntax-source c) + (syntax-line c) + (+ (syntax-column c) delta) + (+ (syntax-position c) delta) + (max 1 (- (syntax-span c) delta)))))) (set! src-col (+ orig-col (syntax-span c)))))] [(graph-reference? (syntax-e c)) (advance c init-line!) @@ -760,6 +792,16 @@ stx->loc-s-expr (cdr (vector->list (struct->vector v)))))] [(box? v) `(box ,(stx->loc-s-expr (unbox v)))] + [(hash? v) `(,(cond + [(hash-eq? v) 'make-immutable-hasheq] + [(hash-eqv? v) 'make-immutable-hasheqv] + [else 'make-immutable-hash]) + (list + ,@(hash-map + v + (lambda (k v) + `(cons (quote ,k) + ,(stx->loc-s-expr v))))))] [else `(quote ,v)]))) (define (cvt s) (datum->syntax #'here (stx->loc-s-expr s) #f)) @@ -823,6 +865,8 @@ (set-box! ht (hash-set (unbox ht) '#%graph-count (add1 n))) n))) + (define-struct forced-pair (car cdr)) + (define (do-syntax-ize v col line ht graph? qq) (cond [((syntax-ize-hook) v col) @@ -944,21 +988,25 @@ (set-box! ht orig-ht) (do-syntax-ize v col line ht #t qq)] [else r])))] - [(pair? v) - (let ([orig-ht (unbox ht)] + [(or (pair? v) + (forced-pair? v)) + (let ([carv (if (pair? v) (car v) (forced-pair-car v))] + [cdrv (if (pair? v) (cdr v) (forced-pair-cdr v))] + [orig-ht (unbox ht)] [graph-box (box (graph-count ht graph?))] [qq (and qq (max 1 qq))]) (set-box! ht (hash-set (unbox ht) v graph-box)) (let* ([inc (if graph? (+ 2 (string-length (format "~a" (unbox graph-box)))) 0)] - [a (do-syntax-ize (car v) (+ col 1 inc) line ht #f qq)] - [sep (if (and (pair? (cdr v)) + [a (do-syntax-ize carv (+ col 1 inc) line ht #f qq)] + [sep (if (and (pair? v) + (pair? cdrv) ;; FIXME: what if it turns out to be a graph reference? - (not (hash-ref (unbox ht) (cdr v) #f))) + (not (hash-ref (unbox ht) cdrv #f))) 0 3)] - [b (do-syntax-ize (cdr v) (+ col 1 inc (syntax-span a) sep) line ht #f qq)]) + [b (do-syntax-ize cdrv (+ col 1 inc (syntax-span a) sep) line ht #f qq)]) (let ([r (datum->syntax #f (cons a b) (vector #f line (+ col inc) (+ 1 col inc) @@ -981,5 +1029,22 @@ (box a) (vector #f line col (+ 1 col) (+ 2 (syntax-span a)))))] + [(hash? v) + (let* ([delta (cond + [(hash-eq? v) 7] + [(hash-eqv? v) 8] + [else 6])] + [pairs (do-syntax-ize (hash-map v make-forced-pair) (+ col delta) line ht #f (and qq (max 1 qq)))]) + (datum->syntax #f + ((cond + [(hash-eq? v) make-immutable-hasheq] + [(hash-eqv? v) make-immutable-hasheqv] + [else make-immutable-hash]) + (map (lambda (p) + (let ([p (syntax-e p)]) + (cons (syntax->datum (car p)) + (cdr p)))) + (syntax->list pairs))) + pairs))] [else (datum->syntax #f v (vector #f line col (+ 1 col) 1))]))) From 0fe701a837565aaf9c4e7f0bb36d2ad43464bb95 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 23 Apr 2010 08:19:21 -0600 Subject: [PATCH 03/12] add for/hasheqv for completeness --- collects/racket/private/for.rkt | 9 +++++++++ collects/scribblings/reference/for.scrbl | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/collects/racket/private/for.rkt b/collects/racket/private/for.rkt index 6a95bc7236..3a252a81dd 100644 --- a/collects/racket/private/for.rkt +++ b/collects/racket/private/for.rkt @@ -22,6 +22,7 @@ for/last for*/last for/hash for*/hash for/hasheq for*/hasheq + for/hasheqv for*/hasheqv for/fold/derived for*/fold/derived @@ -952,6 +953,14 @@ #`(let-values ([(key val) #,x]) (hash-set table key val)))) + (define-for-variants (for/hasheqv for*/hasheqv) + ([table #hasheqv()]) + (lambda (x) x) + (lambda (rhs) rhs) + (lambda (x) + #`(let-values ([(key val) #,x]) + (hash-set table key val)))) + ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; specific sequences diff --git a/collects/scribblings/reference/for.scrbl b/collects/scribblings/reference/for.scrbl index 809f294f89..963d3dbb62 100644 --- a/collects/scribblings/reference/for.scrbl +++ b/collects/scribblings/reference/for.scrbl @@ -89,12 +89,14 @@ expression is a list of the results in order. @deftogether[( @defform[(for/hash (for-clause ...) body ...+)] @defform[(for/hasheq (for-clause ...) body ...+)] +@defform[(for/hasheqv (for-clause ...) body ...+)] )]{ Like @scheme[for/list], but the result is an immutable @tech{hash table}; @scheme[for/hash] creates a table using @scheme[equal?] to -distinguish keys, and @scheme[for/hasheq] produces a table using -@scheme[eq?]. The last expression in the @scheme[body]s must return +distinguish keys, @scheme[for/hasheq] produces a table using +@scheme[eq?], and @scheme[for/hasheqv] produces a table using +@scheme[eqv?]. The last expression in the @scheme[body]s must return two values: a key and a value to extend the hash table accumulated by the iteration. @@ -212,6 +214,7 @@ nested. @defform[(for*/lists (id ...) (for-clause ...) body ...+)] @defform[(for*/hash (for-clause ...) body ...+)] @defform[(for*/hasheq (for-clause ...) body ...+)] +@defform[(for*/hasheqv (for-clause ...) body ...+)] @defform[(for*/and (for-clause ...) body ...+)] @defform[(for*/or (for-clause ...) body ...+)] @defform[(for*/first (for-clause ...) body ...+)] From ab7f9acee2abdc3ca8aa9f53829d78065080dce8 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 23 Apr 2010 08:26:20 -0600 Subject: [PATCH 04/12] add for/set --- collects/racket/set.rkt | 18 +++++++++++++++++- collects/scribblings/reference/sets.scrbl | 15 +++++++++++++++ collects/tests/mzscheme/set.ss | 4 ++++ 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/collects/racket/set.rkt b/collects/racket/set.rkt index 3574e94fd3..2676037d7f 100644 --- a/collects/racket/set.rkt +++ b/collects/racket/set.rkt @@ -7,7 +7,9 @@ set-member? set-add set-remove set-union set-intersect set-subtract set-map set-for-each - (rename-out [*in-set in-set])) + (rename-out [*in-set in-set]) + for/set for/seteq for/seteqv + for*/set for*/seteq for*/seteqv) (define-struct set (ht) #:omit-define-syntaxes @@ -206,3 +208,17 @@ #t ;; loop args ((hash-iterate-next ht pos)))]]))) + +(define-syntax-rule (define-for for/fold/derived for/set set) + (define-syntax (for/set stx) + (syntax-case stx () + [(_ bindings . body) + (quasisyntax/loc stx + (for/fold/derived #,stx ([s (set)]) bindings (set-add s (let () . body))))]))) + +(define-for for/fold/derived for/set set) +(define-for for*/fold/derived for*/set set) +(define-for for/fold/derived for/seteq seteq) +(define-for for*/fold/derived for*/seteq seteq) +(define-for for/fold/derived for/seteqv seteqv) +(define-for for*/fold/derived for*/seteqv seteqv) diff --git a/collects/scribblings/reference/sets.scrbl b/collects/scribblings/reference/sets.scrbl index 2069cf3ca7..32bcf72223 100644 --- a/collects/scribblings/reference/sets.scrbl +++ b/collects/scribblings/reference/sets.scrbl @@ -109,6 +109,7 @@ Applies the procedure @scheme[proc] to each element in @scheme[set] in an unspecified order, accumulating the results into a list.} + @defproc[(set-for-each [set set?] [proc (any/c . -> . any)]) void?]{ @@ -116,7 +117,21 @@ into a list.} Applies @scheme[proc] to each element in @scheme[set] (for the side-effects of @scheme[proc]) in an unspecified order.} + @defproc[(in-set [set set?]) sequence?]{ Explicitly converts a set to a sequence for use with @scheme[for] and other forms.} + +@deftogether[( +@defform[(for/set (for-clause ...) body ...+)] +@defform[(for/seteq (for-clause ...) body ...+)] +@defform[(for/seteqv (for-clause ...) body ...+)] +@defform[(for*/set (for-clause ...) body ...+)] +@defform[(for*/seteq (for-clause ...) body ...+)] +@defform[(for*/seteqv (for-clause ...) body ...+)] +)]{ + +Analogous to @scheme[for/list] and @scheme[for*/list], but to +construct a set instead of a list.} + diff --git a/collects/tests/mzscheme/set.ss b/collects/tests/mzscheme/set.ss index aa7b0175d1..345ca82960 100644 --- a/collects/tests/mzscheme/set.ss +++ b/collects/tests/mzscheme/set.ss @@ -102,4 +102,8 @@ ;; ---------------------------------------- +(test (set 1 2 3) 'for/set (for/set ([i '(0 1 2)]) (add1 i))) + +;; ---------------------------------------- + (report-errs) From 1812515a573df49fde4636df76ebe3946f84f5ff Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 23 Apr 2010 08:39:26 -0600 Subject: [PATCH 05/12] fix xform setup for reader modules, again --- src/racket/gc2/setup.ss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/racket/gc2/setup.ss b/src/racket/gc2/setup.ss index d2b69fa04d..6b30075d6c 100644 --- a/src/racket/gc2/setup.ss +++ b/src/racket/gc2/setup.ss @@ -84,6 +84,7 @@ mzscheme/lang/reader scheme/base/lang/reader scheme/lang/reader + scheme/private/lang/reader scheme/private/provider/lang/reader racket/base/lang/reader racket/private/lang/reader From 256e3fedd298b79e49c6ac89717a19bbc0369e9b Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 23 Apr 2010 12:34:17 -0500 Subject: [PATCH 06/12] fixed a bug with zero-sized htdp/image images interactive with 2htdp/image primitives --- collects/2htdp/private/img-err.ss | 24 +++++++++++++++++++++--- collects/2htdp/tests/test-image.ss | 9 +++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/collects/2htdp/private/img-err.ss b/collects/2htdp/private/img-err.ss index f9f24ebc04..a5bd685678 100644 --- a/collects/2htdp/private/img-err.ss +++ b/collects/2htdp/private/img-err.ss @@ -20,6 +20,7 @@ lang/posn scheme/gui/base "../../mrlib/image-core.ss" + (prefix-in cis: "../../mrlib/cache-image-snip.ss") (for-syntax scheme/base scheme/list)) @@ -270,9 +271,26 @@ [else arg])) (define (image-snip->image is) - (bitmap->image (send is get-bitmap) - (or (send is get-bitmap-mask) - (send (send is get-bitmap) get-loaded-mask)))) + (let ([bm (send is get-bitmap)]) + (cond + [(not bm) + ;; this might mean we have a cache-image-snip% + ;; or it might mean we have a useless snip. + (let-values ([(w h) (if (is-a? is cis:cache-image-snip%) + (send is get-size) + (values 0 0))]) + (make-image (make-polygon + (list (make-point 0 0) + (make-point w 0) + (make-point w h) + (make-point 0 h)) + 'solid "black") + (make-bb w h h) + #f))] + [else + (bitmap->image bm + (or (send is get-bitmap-mask) + (send bm get-loaded-mask)))]))) (define (bitmap->image bm [mask-bm (send bm get-loaded-mask)]) (let ([w (send bm get-width)] diff --git a/collects/2htdp/tests/test-image.ss b/collects/2htdp/tests/test-image.ss index e5dd1c84e5..2db4c687f7 100644 --- a/collects/2htdp/tests/test-image.ss +++ b/collects/2htdp/tests/test-image.ss @@ -46,6 +46,7 @@ scheme/class scheme/gui/base schemeunit + (prefix-in 1: htdp/image) (only-in lang/htdp-advanced equal~?)) (require (for-syntax scheme/base)) @@ -202,6 +203,14 @@ (check-close (image-height (rotate 30 (ellipse 0 100 'solid 'blue))) (ceiling (* (cos (* pi 1/6)) 100))) +;; zero-sized htdp/image images should also work +(test (image-width (1:text "" 18 "blue")) + => + 0) +(test (image-height (1:rectangle 10 0 'solid "red")) + => + 0) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; polygon equality From 6542a36fa56aa4316cd4bf77f2dfffeb7d04cfff Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Fri, 23 Apr 2010 13:58:34 -0400 Subject: [PATCH 07/12] ignore ~-suffixed files --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 186c5e1a58..6f43a4e0ae 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,6 @@ # a common convenient place to set the PLTADDON directory to /add-on/ + +# common backup file suffixes +*~ From 845ebfbeb8625c5b211f1a426a8b80f632716083 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 23 Apr 2010 12:18:42 -0600 Subject: [PATCH 08/12] hash, hasheq, hasheqv, and hash-equal? --- collects/racket/gui/init.ss | 6 - collects/scheme/base.rkt | 4 +- collects/scribblings/reference/hashes.scrbl | 105 +-- collects/scribblings/reference/syntax.scrbl | 10 +- src/racket/src/cstartup.inc | 824 ++++++++++---------- src/racket/src/list.c | 83 ++ src/racket/src/schminc.h | 2 +- src/racket/src/schvers.h | 4 +- 8 files changed, 560 insertions(+), 478 deletions(-) delete mode 100644 collects/racket/gui/init.ss diff --git a/collects/racket/gui/init.ss b/collects/racket/gui/init.ss deleted file mode 100644 index b48a885892..0000000000 --- a/collects/racket/gui/init.ss +++ /dev/null @@ -1,6 +0,0 @@ -#lang racket -(require racket/init - scheme/gui/base) - -(provide (all-from-out racket/init - scheme/gui/base)) diff --git a/collects/scheme/base.rkt b/collects/scheme/base.rkt index 30bbd6da23..a02cf9fd4a 100644 --- a/collects/scheme/base.rkt +++ b/collects/scheme/base.rkt @@ -1,3 +1,5 @@ #lang scheme/private -(provide (except-out (all-from-out racket/base) struct)) +(provide (except-out (all-from-out racket/base) + struct + hash hasheq hasheqv)) diff --git a/collects/scribblings/reference/hashes.scrbl b/collects/scribblings/reference/hashes.scrbl index 2819a19f76..8ca901de97 100644 --- a/collects/scribblings/reference/hashes.scrbl +++ b/collects/scribblings/reference/hashes.scrbl @@ -86,6 +86,11 @@ unpredictable. Returns @scheme[#t] if @scheme[v] is a @tech{hash table}, @scheme[#f] otherwise.} +@defproc[(hash-equal? [hash hash?]) boolean?]{ + +Returns @scheme[#t] if @scheme[hash] compares keys with @scheme[equal?], +@scheme[#f] if it compares with @scheme[eq?] or @scheme[eqv?].} + @defproc[(hash-eqv? [hash hash?]) boolean?]{ Returns @scheme[#t] if @scheme[hash] compares keys with @scheme[eqv?], @@ -102,73 +107,69 @@ Returns @scheme[#t] if @scheme[hash] compares keys with @scheme[eq?], Returns @scheme[#t] if @scheme[hash] retains its keys weakly, @scheme[#f] if it retains keys strongly.} +@deftogether[( +@defproc[(hash [key any/c] [val any/c] ... ...) (and/c hash? hash-equal? immutable?)] +@defproc[(hasheq [key any/c] [val any/c] ... ...) (and/c hash? hash-eq? immutable?)] +@defproc[(hasheqv [key any/c] [val any/c] ... ...) (and/c hash? hash-eqv? immutable?)] +)]{ -@defproc[(make-hash [assocs (listof pair?) null]) hash?]{ +Creates an immutable hash table with each given @scheme[key] mapped to +the following @scheme[val]; each @scheme[key] must have a @scheme[val], +so the total number of arguments to @scheme[hash] must be even. -Creates a mutable hash table that holds keys strongly and that uses -@scheme[equal?] to compare keys. See also @scheme[make-custom-hash]. +The @scheme[hash] procedure creates a table where keys are compared +with @scheme[equal?], @scheme[hasheq] procedure creates a table where +keys are compared with @scheme[eq?], and @scheme[hasheqv] procedure +creates a table where keys are compared with @scheme[eqv?]. + +The @scheme[key] to @scheme[val] mappings are added to the table in +the order that they appear in the argument list, so later mappings can +hide earlier mappings if the @scheme[key]s are equal.} + +@deftogether[( +@defproc[(make-hash [assocs (listof pair?) null]) (and/c hash? hash-equal?)] +@defproc[(make-hasheqv [assocs (listof pair?) null]) (and/c hash? hash-eqv?)] +@defproc[(make-hasheq [assocs (listof pair?) null]) (and/c hash? hash-eq?)] +)]{ + +Creates a mutable hash table that holds keys strongly. + +The @scheme[make-hash] procedure creates a table where keys are +compared with @scheme[equal?], @scheme[make-hasheq] procedure creates +a table where keys are compared with @scheme[eq?], and +@scheme[make-hasheqv] procedure creates a table where keys are +compared with @scheme[eqv?]. The table is initialized with the content of @scheme[assocs]. In each element of @scheme[assocs], the @scheme[car] is a key, and the @scheme[cdr] is the corresponding value. The mappings are added to the table in the order that they appear in @scheme[assocs], so later -mappings can hide earlier mappings.} +mappings can hide earlier mappings. +See also @scheme[make-custom-hash].} -@defproc[(make-hasheqv [assocs (listof pair?) null]) (and/c hash? hash-eqv?)]{ - -Creates a mutable hash table that holds keys strongly and that -uses @scheme[eqv?] to compare keys. The table is initialized with the -content of @scheme[assocs] as in @scheme[make-hash].} - - -@defproc[(make-hasheq [assocs (listof pair?) null]) (and/c hash? hash-eq?)]{ - -Creates a mutable hash table that holds keys strongly and that -uses @scheme[eq?] to compare keys. The table is initialized with the -content of @scheme[assocs] as in @scheme[make-hash].} - - -@defproc[(make-weak-hash [assocs (listof pair?) null]) (and/c hash? hash-weak?)]{ - -Creates a mutable hash table that holds keys weakly and that -uses @scheme[equal?] to compare keys; see also -@scheme[make-weak-custom-hash]. The table is initialized with the -content of @scheme[assocs] as in @scheme[make-hash].} - - -@defproc[(make-weak-hasheqv [assocs (listof pair?) null]) (and/c hash? hash-eqv? hash-weak?)]{ - -Creates a mutable hash table that holds keys weakly and that -uses @scheme[eqv?] to compare keys. The table is initialized with the -content of @scheme[assocs] as in @scheme[make-hash].} - - -@defproc[(make-weak-hasheq [assocs (listof pair?) null]) (and/c hash? hash-eq? hash-weak?)]{ - -Creates a mutable hash table that holds keys weakly and that -uses @scheme[eq?] to compare keys. The table is initialized with the -content of @scheme[assocs] as in @scheme[make-hash].} +@deftogether[( +@defproc[(make-weak-hash [assocs (listof pair?) null]) (and/c hash? hash-equal? hash-weak?)] +@defproc[(make-weak-hasheqv [assocs (listof pair?) null]) (and/c hash? hash-eqv? hash-weak?)] +@defproc[(make-weak-hasheq [assocs (listof pair?) null]) (and/c hash? hash-eq? hash-weak?)] +)]{ +Like @scheme[make-hash], @scheme[make-hasheq], and +@scheme[make-hasheqv], but creates a mutable hash table that holds +keys weakly.} +@deftogether[( @defproc[(make-immutable-hash [assocs (listof pair?)]) - (and/c hash? immutable?)]{ - -Creates an immutable hash table that compares keys with -@scheme[equal?]. The table is created with the content of -@scheme[assocs] as in @scheme[make-hash].} - + (and/c hash? hash-equal? immutable?)] @defproc[(make-immutable-hasheqv [assocs (listof pair?)]) - (and/c hash? hash-eqv? immutable?)]{ - -Like @scheme[make-immutable-hash], but the resulting hash table -compares keys with @scheme[eqv?].} - + (and/c hash? hash-eqv? immutable?)] @defproc[(make-immutable-hasheq [assocs (listof pair?)]) - (and/c hash? hash-eq? immutable?)]{ + (and/c hash? hash-eq? immutable?)] +)]{ -Like @scheme[make-immutable-hash], but the resulting hash table -compares keys with @scheme[eq?].} +Like @scheme[hash], @scheme[hasheq], and @scheme[hasheqv], but accepts +the key--value mapping in association-list form like +@scheme[make-hash], @scheme[make-hasheq], and @scheme[make-hasheqv].} @defproc[(hash-set! [hash (and/c hash? (not/c immutable?))] diff --git a/collects/scribblings/reference/syntax.scrbl b/collects/scribblings/reference/syntax.scrbl index 436b071eb1..26e4eb4f64 100644 --- a/collects/scribblings/reference/syntax.scrbl +++ b/collects/scribblings/reference/syntax.scrbl @@ -49,11 +49,13 @@ Within such specifications, @itemize[ - @item{@racket[...] indicates zero or more - repetitions of the preceding datum.} + @item{@racket[...] indicates zero or more repetitions of the + preceding datum; more generally, @math{N} consecutive + @racket[...]s a row indicate a consecutive repetition of the + preceding @math{N} datums.} - @item{@racket[...+] indicates one or - more repetitions of the preceding datum.} + @item{@racket[...+] indicates one or more repetitions of the + preceding datum.} @item{Italic meta-identifiers play the role of non-terminals. Some meta-identifier names imply syntactic constraints: diff --git a/src/racket/src/cstartup.inc b/src/racket/src/cstartup.inc index bf363c0509..8907f6b94c 100644 --- a/src/racket/src/cstartup.inc +++ b/src/racket/src/cstartup.inc @@ -1,78 +1,78 @@ { - SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,48,51,0,0,0,1,0,0,10,0,13, -0,22,0,26,0,31,0,38,0,51,0,58,0,63,0,68,0,72,0,79,0, + SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,49,51,0,0,0,1,0,0,10,0,13, +0,22,0,29,0,42,0,46,0,53,0,57,0,62,0,65,0,70,0,75,0, 82,0,88,0,102,0,116,0,119,0,125,0,129,0,131,0,142,0,144,0,158, 0,165,0,187,0,189,0,203,0,14,1,43,1,54,1,65,1,75,1,111,1, 144,1,177,1,236,1,46,2,124,2,190,2,195,2,215,2,106,3,126,3,177, 3,243,3,128,4,14,5,66,5,89,5,168,5,0,0,109,7,0,0,69,35, -37,109,105,110,45,115,116,120,29,11,11,68,104,101,114,101,45,115,116,120,63, -108,101,116,64,99,111,110,100,66,117,110,108,101,115,115,72,112,97,114,97,109, -101,116,101,114,105,122,101,66,100,101,102,105,110,101,64,119,104,101,110,64,108, -101,116,42,63,97,110,100,66,108,101,116,114,101,99,62,111,114,65,113,117,111, +37,109,105,110,45,115,116,120,29,11,11,68,104,101,114,101,45,115,116,120,66, +108,101,116,114,101,99,72,112,97,114,97,109,101,116,101,114,105,122,101,63,108, +101,116,66,100,101,102,105,110,101,63,97,110,100,64,108,101,116,42,62,111,114, +64,119,104,101,110,64,99,111,110,100,66,117,110,108,101,115,115,65,113,117,111, 116,101,29,94,2,14,68,35,37,107,101,114,110,101,108,11,29,94,2,14,68, 35,37,112,97,114,97,109,122,11,62,105,102,65,98,101,103,105,110,63,115,116, 120,61,115,70,108,101,116,45,118,97,108,117,101,115,61,120,73,108,101,116,114, 101,99,45,118,97,108,117,101,115,66,108,97,109,98,100,97,1,20,112,97,114, 97,109,101,116,101,114,105,122,97,116,105,111,110,45,107,101,121,61,118,73,100, -101,102,105,110,101,45,118,97,108,117,101,115,97,36,11,8,240,81,77,0,0, -95,159,2,16,36,36,159,2,15,36,36,159,2,15,36,36,16,20,2,4,2, -2,2,6,2,2,2,8,2,2,2,7,2,2,2,9,2,2,2,10,2,2, -2,11,2,2,2,5,2,2,2,12,2,2,2,13,2,2,97,37,11,8,240, -81,77,0,0,93,159,2,15,36,37,16,2,2,3,161,2,2,37,2,3,2, -2,2,3,96,11,11,8,240,81,77,0,0,16,0,96,38,11,8,240,81,77, +101,102,105,110,101,45,118,97,108,117,101,115,97,36,11,8,240,155,78,0,0, +95,159,2,16,36,36,159,2,15,36,36,159,2,15,36,36,16,20,2,5,2, +2,2,6,2,2,2,7,2,2,2,8,2,2,2,10,2,2,2,9,2,2, +2,4,2,2,2,11,2,2,2,12,2,2,2,13,2,2,97,37,11,8,240, +155,78,0,0,93,159,2,15,36,37,16,2,2,3,161,2,2,37,2,3,2, +2,2,3,96,11,11,8,240,155,78,0,0,16,0,96,38,11,8,240,155,78, 0,0,16,0,13,16,4,36,29,11,11,2,2,11,18,16,2,99,64,104,101, -114,101,8,32,8,31,8,30,8,29,8,28,93,8,224,88,77,0,0,95,9, -8,224,88,77,0,0,2,2,27,248,22,143,4,195,249,22,136,4,80,158,39, +114,101,8,32,8,31,8,30,8,29,8,28,93,8,224,162,78,0,0,95,9, +8,224,162,78,0,0,2,2,27,248,22,147,4,195,249,22,140,4,80,158,39, 36,251,22,81,2,17,248,22,96,199,12,249,22,71,2,18,248,22,98,201,27, -248,22,143,4,195,249,22,136,4,80,158,39,36,251,22,81,2,17,248,22,96, -199,249,22,71,2,18,248,22,98,201,12,27,248,22,73,248,22,143,4,196,28, +248,22,147,4,195,249,22,140,4,80,158,39,36,251,22,81,2,17,248,22,96, +199,249,22,71,2,18,248,22,98,201,12,27,248,22,73,248,22,147,4,196,28, 248,22,79,193,20,15,159,37,36,37,28,248,22,79,248,22,73,194,248,22,72, -193,249,22,136,4,80,158,39,36,251,22,81,2,17,248,22,72,199,249,22,71, -2,11,248,22,73,201,11,18,16,2,101,10,8,32,8,31,8,30,8,29,8, -28,16,4,11,11,2,19,3,1,8,101,110,118,49,50,55,57,51,16,4,11, -11,2,20,3,1,8,101,110,118,49,50,55,57,52,93,8,224,89,77,0,0, -95,9,8,224,89,77,0,0,2,2,27,248,22,73,248,22,143,4,196,28,248, +193,249,22,140,4,80,158,39,36,251,22,81,2,17,248,22,72,199,249,22,71, +2,8,248,22,73,201,11,18,16,2,101,10,8,32,8,31,8,30,8,29,8, +28,16,4,11,11,2,19,3,1,8,101,110,118,49,50,54,48,50,16,4,11, +11,2,20,3,1,8,101,110,118,49,50,54,48,51,93,8,224,163,78,0,0, +95,9,8,224,163,78,0,0,2,2,27,248,22,73,248,22,147,4,196,28,248, 22,79,193,20,15,159,37,36,37,28,248,22,79,248,22,73,194,248,22,72,193, -249,22,136,4,80,158,39,36,250,22,81,2,21,248,22,81,249,22,81,248,22, -81,2,22,248,22,72,201,251,22,81,2,17,2,22,2,22,249,22,71,2,13, +249,22,140,4,80,158,39,36,250,22,81,2,21,248,22,81,249,22,81,248,22, +81,2,22,248,22,72,201,251,22,81,2,17,2,22,2,22,249,22,71,2,10, 248,22,73,204,18,16,2,101,11,8,32,8,31,8,30,8,29,8,28,16,4, -11,11,2,19,3,1,8,101,110,118,49,50,55,57,54,16,4,11,11,2,20, -3,1,8,101,110,118,49,50,55,57,55,93,8,224,90,77,0,0,95,9,8, -224,90,77,0,0,2,2,248,22,143,4,193,27,248,22,143,4,194,249,22,71, -248,22,81,248,22,72,196,248,22,73,195,27,248,22,73,248,22,143,4,23,197, -1,249,22,136,4,80,158,39,36,28,248,22,56,248,22,137,4,248,22,72,23, -198,2,27,249,22,2,32,0,89,162,8,44,37,43,9,222,33,40,248,22,143, +11,11,2,19,3,1,8,101,110,118,49,50,54,48,53,16,4,11,11,2,20, +3,1,8,101,110,118,49,50,54,48,54,93,8,224,164,78,0,0,95,9,8, +224,164,78,0,0,2,2,248,22,147,4,193,27,248,22,147,4,194,249,22,71, +248,22,81,248,22,72,196,248,22,73,195,27,248,22,73,248,22,147,4,23,197, +1,249,22,140,4,80,158,39,36,28,248,22,56,248,22,141,4,248,22,72,23, +198,2,27,249,22,2,32,0,89,162,8,44,37,43,9,222,33,40,248,22,147, 4,248,22,96,23,200,2,250,22,81,2,23,248,22,81,249,22,81,248,22,81, 248,22,72,23,204,2,250,22,82,2,24,249,22,2,22,72,23,204,2,248,22, 98,23,206,2,249,22,71,248,22,72,23,202,1,249,22,2,22,96,23,200,1, 250,22,82,2,21,249,22,2,32,0,89,162,8,44,37,47,9,222,33,41,248, -22,143,4,248,22,72,201,248,22,73,198,27,248,22,143,4,194,249,22,71,248, -22,81,248,22,72,196,248,22,73,195,27,248,22,73,248,22,143,4,23,197,1, -249,22,136,4,80,158,39,36,250,22,82,2,23,249,22,2,32,0,89,162,8, -44,37,47,9,222,33,43,248,22,143,4,248,22,72,201,248,22,73,198,27,248, -22,73,248,22,143,4,196,27,248,22,143,4,248,22,72,195,249,22,136,4,80, +22,147,4,248,22,72,201,248,22,73,198,27,248,22,147,4,194,249,22,71,248, +22,81,248,22,72,196,248,22,73,195,27,248,22,73,248,22,147,4,23,197,1, +249,22,140,4,80,158,39,36,250,22,82,2,23,249,22,2,32,0,89,162,8, +44,37,47,9,222,33,43,248,22,147,4,248,22,72,201,248,22,73,198,27,248, +22,73,248,22,147,4,196,27,248,22,147,4,248,22,72,195,249,22,140,4,80, 158,40,36,28,248,22,79,195,250,22,82,2,21,9,248,22,73,199,250,22,81, -2,4,248,22,81,248,22,72,199,250,22,82,2,10,248,22,73,201,248,22,73, -202,27,248,22,73,248,22,143,4,23,197,1,27,249,22,1,22,85,249,22,2, -22,143,4,248,22,143,4,248,22,72,199,249,22,136,4,80,158,40,36,251,22, +2,6,248,22,81,248,22,72,199,250,22,82,2,9,248,22,73,201,248,22,73, +202,27,248,22,73,248,22,147,4,23,197,1,27,249,22,1,22,85,249,22,2, +22,147,4,248,22,147,4,248,22,72,199,249,22,140,4,80,158,40,36,251,22, 81,1,22,119,105,116,104,45,99,111,110,116,105,110,117,97,116,105,111,110,45, 109,97,114,107,2,25,250,22,82,1,23,101,120,116,101,110,100,45,112,97,114, 97,109,101,116,101,114,105,122,97,116,105,111,110,21,95,1,27,99,111,110,116, 105,110,117,97,116,105,111,110,45,109,97,114,107,45,115,101,116,45,102,105,114, 115,116,11,2,25,201,250,22,82,2,21,9,248,22,73,203,27,248,22,73,248, -22,143,4,196,28,248,22,79,193,20,15,159,37,36,37,249,22,136,4,80,158, -39,36,27,248,22,143,4,248,22,72,197,28,249,22,177,8,62,61,62,248,22, -137,4,248,22,96,196,250,22,81,2,21,248,22,81,249,22,81,21,93,2,26, -248,22,72,199,250,22,82,2,5,249,22,81,2,26,249,22,81,248,22,105,203, -2,26,248,22,73,202,251,22,81,2,17,28,249,22,177,8,248,22,137,4,248, +22,147,4,196,28,248,22,79,193,20,15,159,37,36,37,249,22,140,4,80,158, +39,36,27,248,22,147,4,248,22,72,197,28,249,22,181,8,62,61,62,248,22, +141,4,248,22,96,196,250,22,81,2,21,248,22,81,249,22,81,21,93,2,26, +248,22,72,199,250,22,82,2,12,249,22,81,2,26,249,22,81,248,22,105,203, +2,26,248,22,73,202,251,22,81,2,17,28,249,22,181,8,248,22,141,4,248, 22,72,200,64,101,108,115,101,10,248,22,72,197,250,22,82,2,21,9,248,22, -73,200,249,22,71,2,5,248,22,73,202,100,8,32,8,31,8,30,8,29,8, -28,16,4,11,11,2,19,3,1,8,101,110,118,49,50,56,49,57,16,4,11, -11,2,20,3,1,8,101,110,118,49,50,56,50,48,93,8,224,91,77,0,0, -18,16,2,158,94,10,64,118,111,105,100,8,48,95,9,8,224,91,77,0,0, -2,2,27,248,22,73,248,22,143,4,196,249,22,136,4,80,158,39,36,28,248, -22,56,248,22,137,4,248,22,72,197,250,22,81,2,27,248,22,81,248,22,72, -199,248,22,96,198,27,248,22,137,4,248,22,72,197,250,22,81,2,27,248,22, +73,200,249,22,71,2,12,248,22,73,202,100,8,32,8,31,8,30,8,29,8, +28,16,4,11,11,2,19,3,1,8,101,110,118,49,50,54,50,56,16,4,11, +11,2,20,3,1,8,101,110,118,49,50,54,50,57,93,8,224,165,78,0,0, +18,16,2,158,94,10,64,118,111,105,100,8,48,95,9,8,224,165,78,0,0, +2,2,27,248,22,73,248,22,147,4,196,249,22,140,4,80,158,39,36,28,248, +22,56,248,22,141,4,248,22,72,197,250,22,81,2,27,248,22,81,248,22,72, +199,248,22,96,198,27,248,22,141,4,248,22,72,197,250,22,81,2,27,248,22, 81,248,22,72,197,250,22,82,2,24,248,22,73,199,248,22,73,202,159,36,20, 105,159,36,16,1,11,16,0,83,158,42,20,103,145,2,1,2,1,2,2,11, 11,11,10,36,80,158,36,36,20,105,159,36,16,0,16,0,16,1,2,3,37, @@ -81,25 +81,25 @@ 11,11,11,11,11,16,10,2,4,2,5,2,6,2,7,2,8,2,9,2,10, 2,11,2,12,2,13,36,46,37,11,11,11,16,0,16,0,16,0,36,36,11, 11,11,11,16,0,16,0,16,0,36,36,16,11,16,5,2,3,20,15,159,36, -36,36,36,20,105,159,36,16,0,16,1,33,33,10,16,5,2,6,89,162,8, +36,36,36,20,105,159,36,16,0,16,1,33,33,10,16,5,2,13,89,162,8, 44,37,53,9,223,0,33,34,36,20,105,159,36,16,1,2,3,16,0,11,16, -5,2,9,89,162,8,44,37,53,9,223,0,33,35,36,20,105,159,36,16,1, -2,3,16,0,11,16,5,2,11,89,162,8,44,37,53,9,223,0,33,36,36, -20,105,159,36,16,1,2,3,16,1,33,37,11,16,5,2,13,89,162,8,44, +5,2,11,89,162,8,44,37,53,9,223,0,33,35,36,20,105,159,36,16,1, +2,3,16,0,11,16,5,2,8,89,162,8,44,37,53,9,223,0,33,36,36, +20,105,159,36,16,1,2,3,16,1,33,37,11,16,5,2,10,89,162,8,44, 37,56,9,223,0,33,38,36,20,105,159,36,16,1,2,3,16,1,33,39,11, -16,5,2,4,89,162,8,44,37,58,9,223,0,33,42,36,20,105,159,36,16, -1,2,3,16,0,11,16,5,2,12,89,162,8,44,37,53,9,223,0,33,44, -36,20,105,159,36,16,1,2,3,16,0,11,16,5,2,10,89,162,8,44,37, +16,5,2,6,89,162,8,44,37,58,9,223,0,33,42,36,20,105,159,36,16, +1,2,3,16,0,11,16,5,2,4,89,162,8,44,37,53,9,223,0,33,44, +36,20,105,159,36,16,1,2,3,16,0,11,16,5,2,9,89,162,8,44,37, 54,9,223,0,33,45,36,20,105,159,36,16,1,2,3,16,0,11,16,5,2, -7,89,162,8,44,37,55,9,223,0,33,46,36,20,105,159,36,16,1,2,3, -16,0,11,16,5,2,5,89,162,8,44,37,58,9,223,0,33,47,36,20,105, -159,36,16,1,2,3,16,1,33,49,11,16,5,2,8,89,162,8,44,37,54, +5,89,162,8,44,37,55,9,223,0,33,46,36,20,105,159,36,16,1,2,3, +16,0,11,16,5,2,12,89,162,8,44,37,58,9,223,0,33,47,36,20,105, +159,36,16,1,2,3,16,1,33,49,11,16,5,2,7,89,162,8,44,37,54, 9,223,0,33,50,36,20,105,159,36,16,1,2,3,16,0,11,16,0,94,2, 15,2,16,93,2,15,9,9,36,0}; EVAL_ONE_SIZED_STR((char *)expr, 2025); } { - SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,48,65,0,0,0,1,0,0,8,0,21, + SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,49,65,0,0,0,1,0,0,8,0,21, 0,26,0,43,0,58,0,76,0,92,0,102,0,120,0,140,0,156,0,174,0, 205,0,234,0,0,1,14,1,20,1,34,1,39,1,49,1,57,1,85,1,117, 1,123,1,168,1,213,1,237,1,20,2,22,2,188,2,22,4,63,4,136,5, @@ -132,234 +132,234 @@ 32,111,114,32,98,121,116,101,32,115,116,114,105,110,103,6,36,36,99,97,110, 110,111,116,32,97,100,100,32,97,32,115,117,102,102,105,120,32,116,111,32,97, 32,114,111,111,116,32,112,97,116,104,58,32,5,0,27,20,14,159,80,159,37, -51,38,250,80,159,40,52,38,249,22,27,11,80,159,42,51,38,22,146,13,10, -248,22,169,5,23,196,2,28,248,22,166,6,23,194,2,12,87,94,248,22,183, +51,38,250,80,159,40,52,38,249,22,27,11,80,159,42,51,38,22,150,13,10, +248,22,173,5,23,196,2,28,248,22,170,6,23,194,2,12,87,94,248,22,187, 8,23,194,1,27,20,14,159,80,159,38,51,38,250,80,159,41,52,38,249,22, -27,11,80,159,43,51,38,22,146,13,10,248,22,169,5,23,197,2,28,248,22, -166,6,23,194,2,12,87,94,248,22,183,8,23,194,1,27,20,14,159,80,159, -39,51,38,250,80,159,42,52,38,249,22,27,11,80,159,44,51,38,22,146,13, -10,248,22,169,5,23,198,2,28,248,22,166,6,23,194,2,12,87,94,248,22, -183,8,23,194,1,248,80,159,40,54,37,197,28,248,22,79,23,195,2,9,27, -248,22,72,23,196,2,27,28,248,22,130,14,23,195,2,23,194,1,28,248,22, -129,14,23,195,2,249,22,131,14,23,196,1,250,80,158,43,49,248,22,146,14, -2,20,11,10,250,80,158,41,49,248,22,146,14,2,20,23,197,1,10,28,23, -193,2,249,22,71,248,22,133,14,249,22,131,14,23,198,1,247,22,147,14,27, +27,11,80,159,43,51,38,22,150,13,10,248,22,173,5,23,197,2,28,248,22, +170,6,23,194,2,12,87,94,248,22,187,8,23,194,1,27,20,14,159,80,159, +39,51,38,250,80,159,42,52,38,249,22,27,11,80,159,44,51,38,22,150,13, +10,248,22,173,5,23,198,2,28,248,22,170,6,23,194,2,12,87,94,248,22, +187,8,23,194,1,248,80,159,40,54,37,197,28,248,22,79,23,195,2,9,27, +248,22,72,23,196,2,27,28,248,22,134,14,23,195,2,23,194,1,28,248,22, +133,14,23,195,2,249,22,135,14,23,196,1,250,80,158,43,49,248,22,150,14, +2,20,11,10,250,80,158,41,49,248,22,150,14,2,20,23,197,1,10,28,23, +193,2,249,22,71,248,22,137,14,249,22,135,14,23,198,1,247,22,151,14,27, 248,22,73,23,200,1,28,248,22,79,23,194,2,9,27,248,22,72,23,195,2, -27,28,248,22,130,14,23,195,2,23,194,1,28,248,22,129,14,23,195,2,249, -22,131,14,23,196,1,250,80,158,48,49,248,22,146,14,2,20,11,10,250,80, -158,46,49,248,22,146,14,2,20,23,197,1,10,28,23,193,2,249,22,71,248, -22,133,14,249,22,131,14,23,198,1,247,22,147,14,248,80,159,46,53,37,248, +27,28,248,22,134,14,23,195,2,23,194,1,28,248,22,133,14,23,195,2,249, +22,135,14,23,196,1,250,80,158,48,49,248,22,150,14,2,20,11,10,250,80, +158,46,49,248,22,150,14,2,20,23,197,1,10,28,23,193,2,249,22,71,248, +22,137,14,249,22,135,14,23,198,1,247,22,151,14,248,80,159,46,53,37,248, 22,73,23,199,1,87,94,23,193,1,248,80,159,44,53,37,248,22,73,23,197, 1,87,94,23,193,1,27,248,22,73,23,198,1,28,248,22,79,23,194,2,9, -27,248,22,72,23,195,2,27,28,248,22,130,14,23,195,2,23,194,1,28,248, -22,129,14,23,195,2,249,22,131,14,23,196,1,250,80,158,46,49,248,22,146, -14,2,20,11,10,250,80,158,44,49,248,22,146,14,2,20,23,197,1,10,28, -23,193,2,249,22,71,248,22,133,14,249,22,131,14,23,198,1,247,22,147,14, +27,248,22,72,23,195,2,27,28,248,22,134,14,23,195,2,23,194,1,28,248, +22,133,14,23,195,2,249,22,135,14,23,196,1,250,80,158,46,49,248,22,150, +14,2,20,11,10,250,80,158,44,49,248,22,150,14,2,20,23,197,1,10,28, +23,193,2,249,22,71,248,22,137,14,249,22,135,14,23,198,1,247,22,151,14, 248,80,159,44,53,37,248,22,73,23,199,1,248,80,159,42,53,37,248,22,73, -196,27,248,22,170,13,23,195,2,28,23,193,2,192,87,94,23,193,1,28,248, -22,171,6,23,195,2,27,248,22,128,14,195,28,192,192,248,22,129,14,195,11, -87,94,28,28,248,22,171,13,23,195,2,10,28,248,22,170,13,23,195,2,10, -28,248,22,171,6,23,195,2,28,248,22,128,14,23,195,2,10,248,22,129,14, -23,195,2,11,12,250,22,147,9,76,110,111,114,109,97,108,45,112,97,116,104, +196,27,248,22,174,13,23,195,2,28,23,193,2,192,87,94,23,193,1,28,248, +22,175,6,23,195,2,27,248,22,132,14,195,28,192,192,248,22,133,14,195,11, +87,94,28,28,248,22,175,13,23,195,2,10,28,248,22,174,13,23,195,2,10, +28,248,22,175,6,23,195,2,28,248,22,132,14,23,195,2,10,248,22,133,14, +23,195,2,11,12,250,22,151,9,76,110,111,114,109,97,108,45,112,97,116,104, 45,99,97,115,101,6,42,42,112,97,116,104,32,40,102,111,114,32,97,110,121, 32,115,121,115,116,101,109,41,32,111,114,32,118,97,108,105,100,45,112,97,116, -104,32,115,116,114,105,110,103,23,197,2,28,28,248,22,171,13,23,195,2,249, -22,177,8,248,22,172,13,23,197,2,2,21,249,22,177,8,247,22,190,7,2, -21,27,28,248,22,171,6,23,196,2,23,195,2,248,22,180,7,248,22,175,13, -23,197,2,28,249,22,161,14,0,21,35,114,120,34,94,91,92,92,93,91,92, -92,93,91,63,93,91,92,92,93,34,23,195,2,28,248,22,171,6,195,248,22, -178,13,195,194,27,248,22,146,7,23,195,1,249,22,179,13,248,22,183,7,250, -22,169,14,0,6,35,114,120,34,47,34,28,249,22,161,14,0,22,35,114,120, +104,32,115,116,114,105,110,103,23,197,2,28,28,248,22,175,13,23,195,2,249, +22,181,8,248,22,176,13,23,197,2,2,21,249,22,181,8,247,22,130,8,2, +21,27,28,248,22,175,6,23,196,2,23,195,2,248,22,184,7,248,22,179,13, +23,197,2,28,249,22,165,14,0,21,35,114,120,34,94,91,92,92,93,91,92, +92,93,91,63,93,91,92,92,93,34,23,195,2,28,248,22,175,6,195,248,22, +182,13,195,194,27,248,22,150,7,23,195,1,249,22,183,13,248,22,187,7,250, +22,173,14,0,6,35,114,120,34,47,34,28,249,22,165,14,0,22,35,114,120, 34,91,47,92,92,93,91,46,32,93,43,91,47,92,92,93,42,36,34,23,201, -2,23,199,1,250,22,169,14,0,19,35,114,120,34,91,32,46,93,43,40,91, +2,23,199,1,250,22,173,14,0,19,35,114,120,34,91,32,46,93,43,40,91, 47,92,92,93,42,41,36,34,23,202,1,6,2,2,92,49,80,159,44,37,38, -2,21,28,248,22,171,6,194,248,22,178,13,194,193,87,94,28,28,248,22,170, -13,23,195,2,10,28,248,22,171,6,23,195,2,28,248,22,128,14,23,195,2, -10,248,22,129,14,23,195,2,11,12,250,22,147,9,23,196,2,2,22,23,197, -2,28,248,22,128,14,23,195,2,12,248,22,186,11,249,22,128,11,248,22,136, -7,250,22,155,7,2,23,23,200,1,23,201,1,247,22,23,87,94,28,28,248, -22,170,13,23,195,2,10,28,248,22,171,6,23,195,2,28,248,22,128,14,23, -195,2,10,248,22,129,14,23,195,2,11,12,250,22,147,9,23,196,2,2,22, -23,197,2,28,248,22,128,14,23,195,2,12,248,22,186,11,249,22,128,11,248, -22,136,7,250,22,155,7,2,23,23,200,1,23,201,1,247,22,23,87,94,87, -94,28,28,248,22,170,13,23,195,2,10,28,248,22,171,6,23,195,2,28,248, -22,128,14,23,195,2,10,248,22,129,14,23,195,2,11,12,250,22,147,9,195, -2,22,23,197,2,28,248,22,128,14,23,195,2,12,248,22,186,11,249,22,128, -11,248,22,136,7,250,22,155,7,2,23,199,23,201,1,247,22,23,249,22,3, -89,162,8,44,37,50,9,223,2,33,35,196,87,94,28,28,248,22,170,13,23, -194,2,10,28,248,22,171,6,23,194,2,28,248,22,128,14,23,194,2,10,248, -22,129,14,23,194,2,11,12,250,22,147,9,2,7,2,22,23,196,2,28,248, -22,128,14,23,194,2,12,248,22,186,11,249,22,128,11,248,22,136,7,250,22, -155,7,2,23,2,7,23,200,1,247,22,23,32,38,89,162,8,44,40,55,2, -24,222,33,39,28,248,22,79,23,197,2,87,94,23,196,1,248,22,186,11,249, -22,161,11,251,22,155,7,2,25,2,7,28,248,22,79,23,203,2,87,94,23, -202,1,23,201,1,250,22,1,22,188,13,23,204,1,23,205,1,23,200,1,247, -22,23,27,249,22,188,13,248,22,72,23,200,2,23,197,2,28,248,22,183,13, -23,194,2,27,250,22,1,22,188,13,23,197,1,199,28,248,22,183,13,193,192, +2,21,28,248,22,175,6,194,248,22,182,13,194,193,87,94,28,28,248,22,174, +13,23,195,2,10,28,248,22,175,6,23,195,2,28,248,22,132,14,23,195,2, +10,248,22,133,14,23,195,2,11,12,250,22,151,9,23,196,2,2,22,23,197, +2,28,248,22,132,14,23,195,2,12,248,22,190,11,249,22,132,11,248,22,140, +7,250,22,159,7,2,23,23,200,1,23,201,1,247,22,23,87,94,28,28,248, +22,174,13,23,195,2,10,28,248,22,175,6,23,195,2,28,248,22,132,14,23, +195,2,10,248,22,133,14,23,195,2,11,12,250,22,151,9,23,196,2,2,22, +23,197,2,28,248,22,132,14,23,195,2,12,248,22,190,11,249,22,132,11,248, +22,140,7,250,22,159,7,2,23,23,200,1,23,201,1,247,22,23,87,94,87, +94,28,28,248,22,174,13,23,195,2,10,28,248,22,175,6,23,195,2,28,248, +22,132,14,23,195,2,10,248,22,133,14,23,195,2,11,12,250,22,151,9,195, +2,22,23,197,2,28,248,22,132,14,23,195,2,12,248,22,190,11,249,22,132, +11,248,22,140,7,250,22,159,7,2,23,199,23,201,1,247,22,23,249,22,3, +89,162,8,44,37,50,9,223,2,33,35,196,87,94,28,28,248,22,174,13,23, +194,2,10,28,248,22,175,6,23,194,2,28,248,22,132,14,23,194,2,10,248, +22,133,14,23,194,2,11,12,250,22,151,9,2,7,2,22,23,196,2,28,248, +22,132,14,23,194,2,12,248,22,190,11,249,22,132,11,248,22,140,7,250,22, +159,7,2,23,2,7,23,200,1,247,22,23,32,38,89,162,8,44,40,55,2, +24,222,33,39,28,248,22,79,23,197,2,87,94,23,196,1,248,22,190,11,249, +22,165,11,251,22,159,7,2,25,2,7,28,248,22,79,23,203,2,87,94,23, +202,1,23,201,1,250,22,1,22,128,14,23,204,1,23,205,1,23,200,1,247, +22,23,27,249,22,128,14,248,22,72,23,200,2,23,197,2,28,248,22,187,13, +23,194,2,27,250,22,1,22,128,14,23,197,1,199,28,248,22,187,13,193,192, 251,2,38,198,199,200,248,22,73,202,251,2,38,197,198,199,248,22,73,201,87, -94,87,94,87,94,28,28,248,22,170,13,193,10,28,248,22,171,6,193,28,248, -22,128,14,193,10,248,22,129,14,193,11,12,250,22,147,9,2,7,2,22,195, -28,248,22,128,14,193,12,248,22,186,11,249,22,128,11,248,22,136,7,250,22, -155,7,2,23,2,7,199,247,22,23,249,22,3,32,0,89,162,8,44,37,49, -9,222,33,37,195,27,247,22,148,14,251,2,38,196,197,198,196,32,41,89,162, +94,87,94,87,94,28,28,248,22,174,13,193,10,28,248,22,175,6,193,28,248, +22,132,14,193,10,248,22,133,14,193,11,12,250,22,151,9,2,7,2,22,195, +28,248,22,132,14,193,12,248,22,190,11,249,22,132,11,248,22,140,7,250,22, +159,7,2,23,2,7,199,247,22,23,249,22,3,32,0,89,162,8,44,37,49, +9,222,33,37,195,27,247,22,152,14,251,2,38,196,197,198,196,32,41,89,162, 44,42,59,2,24,222,33,42,28,248,22,79,23,199,2,87,94,23,198,1,248, -23,196,1,251,22,155,7,2,25,23,199,1,28,248,22,79,23,203,2,87,94, -23,202,1,23,201,1,250,22,1,22,188,13,23,204,1,23,205,1,23,198,1, -27,249,22,188,13,248,22,72,23,202,2,23,199,2,28,248,22,183,13,23,194, -2,27,250,22,1,22,188,13,23,197,1,23,202,2,28,248,22,183,13,23,194, +23,196,1,251,22,159,7,2,25,23,199,1,28,248,22,79,23,203,2,87,94, +23,202,1,23,201,1,250,22,1,22,128,14,23,204,1,23,205,1,23,198,1, +27,249,22,128,14,248,22,72,23,202,2,23,199,2,28,248,22,187,13,23,194, +2,27,250,22,1,22,128,14,23,197,1,23,202,2,28,248,22,187,13,23,194, 2,192,87,94,23,193,1,27,248,22,73,23,202,1,28,248,22,79,23,194,2, -87,94,23,193,1,248,23,199,1,251,22,155,7,2,25,23,202,1,28,248,22, -79,23,206,2,87,94,23,205,1,23,204,1,250,22,1,22,188,13,23,207,1, -23,208,1,23,201,1,27,249,22,188,13,248,22,72,23,197,2,23,202,2,28, -248,22,183,13,23,194,2,27,250,22,1,22,188,13,23,197,1,204,28,248,22, -183,13,193,192,253,2,41,203,204,205,206,23,15,248,22,73,201,253,2,41,202, +87,94,23,193,1,248,23,199,1,251,22,159,7,2,25,23,202,1,28,248,22, +79,23,206,2,87,94,23,205,1,23,204,1,250,22,1,22,128,14,23,207,1, +23,208,1,23,201,1,27,249,22,128,14,248,22,72,23,197,2,23,202,2,28, +248,22,187,13,23,194,2,27,250,22,1,22,128,14,23,197,1,204,28,248,22, +187,13,193,192,253,2,41,203,204,205,206,23,15,248,22,73,201,253,2,41,202, 203,204,205,206,248,22,73,200,87,94,23,193,1,27,248,22,73,23,201,1,28, -248,22,79,23,194,2,87,94,23,193,1,248,23,198,1,251,22,155,7,2,25, +248,22,79,23,194,2,87,94,23,193,1,248,23,198,1,251,22,159,7,2,25, 23,201,1,28,248,22,79,23,205,2,87,94,23,204,1,23,203,1,250,22,1, -22,188,13,23,206,1,23,207,1,23,200,1,27,249,22,188,13,248,22,72,23, -197,2,23,201,2,28,248,22,183,13,23,194,2,27,250,22,1,22,188,13,23, -197,1,203,28,248,22,183,13,193,192,253,2,41,202,203,204,205,206,248,22,73, -201,253,2,41,201,202,203,204,205,248,22,73,200,27,247,22,148,14,253,2,41, -198,199,200,201,202,198,87,95,28,28,248,22,171,13,23,194,2,10,28,248,22, -170,13,23,194,2,10,28,248,22,171,6,23,194,2,28,248,22,128,14,23,194, -2,10,248,22,129,14,23,194,2,11,12,252,22,147,9,23,200,2,2,26,36, -23,198,2,23,199,2,28,28,248,22,171,6,23,195,2,10,248,22,159,7,23, -195,2,87,94,23,194,1,12,252,22,147,9,23,200,2,2,27,37,23,198,2, -23,199,1,91,159,39,11,90,161,39,36,11,248,22,191,13,23,197,2,87,94, -23,195,1,87,94,28,192,12,250,22,148,9,23,201,1,2,28,23,199,1,249, -22,7,194,195,91,159,38,11,90,161,38,36,11,87,95,28,28,248,22,171,13, -23,196,2,10,28,248,22,170,13,23,196,2,10,28,248,22,171,6,23,196,2, -28,248,22,128,14,23,196,2,10,248,22,129,14,23,196,2,11,12,252,22,147, -9,2,10,2,26,36,23,200,2,23,201,2,28,28,248,22,171,6,23,197,2, -10,248,22,159,7,23,197,2,12,252,22,147,9,2,10,2,27,37,23,200,2, -23,201,2,91,159,39,11,90,161,39,36,11,248,22,191,13,23,199,2,87,94, -23,195,1,87,94,28,192,12,250,22,148,9,2,10,2,28,23,201,2,249,22, -7,194,195,27,249,22,180,13,250,22,168,14,0,20,35,114,120,35,34,40,63, -58,91,46,93,91,94,46,93,42,124,41,36,34,248,22,176,13,23,201,1,28, -248,22,171,6,23,203,2,249,22,183,7,23,204,1,8,63,23,202,1,28,248, -22,171,13,23,199,2,248,22,172,13,23,199,1,87,94,23,198,1,247,22,173, -13,28,248,22,170,13,194,249,22,188,13,195,194,192,91,159,38,11,90,161,38, -36,11,87,95,28,28,248,22,171,13,23,196,2,10,28,248,22,170,13,23,196, -2,10,28,248,22,171,6,23,196,2,28,248,22,128,14,23,196,2,10,248,22, -129,14,23,196,2,11,12,252,22,147,9,2,11,2,26,36,23,200,2,23,201, -2,28,28,248,22,171,6,23,197,2,10,248,22,159,7,23,197,2,12,252,22, -147,9,2,11,2,27,37,23,200,2,23,201,2,91,159,39,11,90,161,39,36, -11,248,22,191,13,23,199,2,87,94,23,195,1,87,94,28,192,12,250,22,148, -9,2,11,2,28,23,201,2,249,22,7,194,195,27,249,22,180,13,249,22,169, -7,250,22,169,14,0,9,35,114,120,35,34,91,46,93,34,248,22,176,13,23, -203,1,6,1,1,95,28,248,22,171,6,23,202,2,249,22,183,7,23,203,1, -8,63,23,201,1,28,248,22,171,13,23,199,2,248,22,172,13,23,199,1,87, -94,23,198,1,247,22,173,13,28,248,22,170,13,194,249,22,188,13,195,194,192, -249,247,22,138,5,194,11,249,80,159,38,47,37,9,9,249,80,159,38,47,37, -195,9,27,247,22,150,14,249,80,158,39,48,28,23,195,2,27,248,22,188,7, +22,128,14,23,206,1,23,207,1,23,200,1,27,249,22,128,14,248,22,72,23, +197,2,23,201,2,28,248,22,187,13,23,194,2,27,250,22,1,22,128,14,23, +197,1,203,28,248,22,187,13,193,192,253,2,41,202,203,204,205,206,248,22,73, +201,253,2,41,201,202,203,204,205,248,22,73,200,27,247,22,152,14,253,2,41, +198,199,200,201,202,198,87,95,28,28,248,22,175,13,23,194,2,10,28,248,22, +174,13,23,194,2,10,28,248,22,175,6,23,194,2,28,248,22,132,14,23,194, +2,10,248,22,133,14,23,194,2,11,12,252,22,151,9,23,200,2,2,26,36, +23,198,2,23,199,2,28,28,248,22,175,6,23,195,2,10,248,22,163,7,23, +195,2,87,94,23,194,1,12,252,22,151,9,23,200,2,2,27,37,23,198,2, +23,199,1,91,159,39,11,90,161,39,36,11,248,22,131,14,23,197,2,87,94, +23,195,1,87,94,28,192,12,250,22,152,9,23,201,1,2,28,23,199,1,249, +22,7,194,195,91,159,38,11,90,161,38,36,11,87,95,28,28,248,22,175,13, +23,196,2,10,28,248,22,174,13,23,196,2,10,28,248,22,175,6,23,196,2, +28,248,22,132,14,23,196,2,10,248,22,133,14,23,196,2,11,12,252,22,151, +9,2,10,2,26,36,23,200,2,23,201,2,28,28,248,22,175,6,23,197,2, +10,248,22,163,7,23,197,2,12,252,22,151,9,2,10,2,27,37,23,200,2, +23,201,2,91,159,39,11,90,161,39,36,11,248,22,131,14,23,199,2,87,94, +23,195,1,87,94,28,192,12,250,22,152,9,2,10,2,28,23,201,2,249,22, +7,194,195,27,249,22,184,13,250,22,172,14,0,20,35,114,120,35,34,40,63, +58,91,46,93,91,94,46,93,42,124,41,36,34,248,22,180,13,23,201,1,28, +248,22,175,6,23,203,2,249,22,187,7,23,204,1,8,63,23,202,1,28,248, +22,175,13,23,199,2,248,22,176,13,23,199,1,87,94,23,198,1,247,22,177, +13,28,248,22,174,13,194,249,22,128,14,195,194,192,91,159,38,11,90,161,38, +36,11,87,95,28,28,248,22,175,13,23,196,2,10,28,248,22,174,13,23,196, +2,10,28,248,22,175,6,23,196,2,28,248,22,132,14,23,196,2,10,248,22, +133,14,23,196,2,11,12,252,22,151,9,2,11,2,26,36,23,200,2,23,201, +2,28,28,248,22,175,6,23,197,2,10,248,22,163,7,23,197,2,12,252,22, +151,9,2,11,2,27,37,23,200,2,23,201,2,91,159,39,11,90,161,39,36, +11,248,22,131,14,23,199,2,87,94,23,195,1,87,94,28,192,12,250,22,152, +9,2,11,2,28,23,201,2,249,22,7,194,195,27,249,22,184,13,249,22,173, +7,250,22,173,14,0,9,35,114,120,35,34,91,46,93,34,248,22,180,13,23, +203,1,6,1,1,95,28,248,22,175,6,23,202,2,249,22,187,7,23,203,1, +8,63,23,201,1,28,248,22,175,13,23,199,2,248,22,176,13,23,199,1,87, +94,23,198,1,247,22,177,13,28,248,22,174,13,194,249,22,128,14,195,194,192, +249,247,22,142,5,194,11,249,80,159,38,47,37,9,9,249,80,159,38,47,37, +195,9,27,247,22,154,14,249,80,158,39,48,28,23,195,2,27,248,22,128,8, 6,11,11,80,76,84,67,79,76,76,69,67,84,83,28,192,192,6,0,0,6, -0,0,27,28,23,196,1,250,22,188,13,248,22,146,14,69,97,100,100,111,110, -45,100,105,114,247,22,186,7,6,8,8,99,111,108,108,101,99,116,115,11,27, -248,80,159,42,53,37,250,22,85,23,203,1,248,22,81,248,22,146,14,72,99, +0,0,27,28,23,196,1,250,22,128,14,248,22,150,14,69,97,100,100,111,110, +45,100,105,114,247,22,190,7,6,8,8,99,111,108,108,101,99,116,115,11,27, +248,80,159,42,53,37,250,22,85,23,203,1,248,22,81,248,22,150,14,72,99, 111,108,108,101,99,116,115,45,100,105,114,23,204,1,28,193,249,22,71,195,194, -192,32,51,89,162,8,44,39,8,31,2,19,222,33,52,27,249,22,157,14,23, +192,32,51,89,162,8,44,39,8,31,2,19,222,33,52,27,249,22,161,14,23, 197,2,23,198,2,28,23,193,2,87,94,23,196,1,27,248,22,96,23,195,2, -27,27,248,22,105,23,197,1,27,249,22,157,14,23,201,2,23,196,2,28,23, +27,27,248,22,105,23,197,1,27,249,22,161,14,23,201,2,23,196,2,28,23, 193,2,87,94,23,194,1,27,248,22,96,23,195,2,27,27,248,22,105,23,197, -1,27,249,22,157,14,23,205,2,23,196,2,28,23,193,2,87,94,23,194,1, -27,248,22,96,23,195,2,27,27,248,22,105,23,197,1,27,249,22,157,14,23, +1,27,249,22,161,14,23,205,2,23,196,2,28,23,193,2,87,94,23,194,1, +27,248,22,96,23,195,2,27,27,248,22,105,23,197,1,27,249,22,161,14,23, 209,2,23,196,2,28,23,193,2,87,94,23,194,1,27,248,22,96,23,195,2, -27,27,248,22,105,23,197,1,27,249,22,157,14,23,213,2,23,196,2,28,23, +27,27,248,22,105,23,197,1,27,249,22,161,14,23,213,2,23,196,2,28,23, 193,2,87,94,23,194,1,27,248,22,96,23,195,2,27,250,2,51,23,215,2, -23,216,1,248,22,105,23,199,1,28,249,22,165,7,23,196,2,2,29,249,22, -85,23,214,2,194,249,22,71,248,22,179,13,23,197,1,194,87,95,23,211,1, -23,193,1,28,249,22,165,7,23,196,2,2,29,249,22,85,23,212,2,9,249, -22,71,248,22,179,13,23,197,1,9,28,249,22,165,7,23,196,2,2,29,249, -22,85,23,210,2,194,249,22,71,248,22,179,13,23,197,1,194,87,94,23,193, -1,28,249,22,165,7,23,196,2,2,29,249,22,85,23,208,2,9,249,22,71, -248,22,179,13,23,197,1,9,28,249,22,165,7,23,196,2,2,29,249,22,85, -23,206,2,194,249,22,71,248,22,179,13,23,197,1,194,87,94,23,193,1,28, -249,22,165,7,23,196,2,2,29,249,22,85,23,204,2,9,249,22,71,248,22, -179,13,23,197,1,9,28,249,22,165,7,23,196,2,2,29,249,22,85,23,202, -2,194,249,22,71,248,22,179,13,23,197,1,194,87,94,23,193,1,28,249,22, -165,7,23,196,2,2,29,249,22,85,23,200,2,9,249,22,71,248,22,179,13, -23,197,1,9,28,249,22,165,7,23,196,2,2,29,249,22,85,197,194,87,94, -23,196,1,249,22,71,248,22,179,13,23,197,1,194,87,94,23,193,1,28,249, -22,165,7,23,198,2,2,29,249,22,85,195,9,87,94,23,194,1,249,22,71, -248,22,179,13,23,199,1,9,87,95,28,28,248,22,159,7,194,10,248,22,171, -6,194,12,250,22,147,9,2,14,6,21,21,98,121,116,101,32,115,116,114,105, +23,216,1,248,22,105,23,199,1,28,249,22,169,7,23,196,2,2,29,249,22, +85,23,214,2,194,249,22,71,248,22,183,13,23,197,1,194,87,95,23,211,1, +23,193,1,28,249,22,169,7,23,196,2,2,29,249,22,85,23,212,2,9,249, +22,71,248,22,183,13,23,197,1,9,28,249,22,169,7,23,196,2,2,29,249, +22,85,23,210,2,194,249,22,71,248,22,183,13,23,197,1,194,87,94,23,193, +1,28,249,22,169,7,23,196,2,2,29,249,22,85,23,208,2,9,249,22,71, +248,22,183,13,23,197,1,9,28,249,22,169,7,23,196,2,2,29,249,22,85, +23,206,2,194,249,22,71,248,22,183,13,23,197,1,194,87,94,23,193,1,28, +249,22,169,7,23,196,2,2,29,249,22,85,23,204,2,9,249,22,71,248,22, +183,13,23,197,1,9,28,249,22,169,7,23,196,2,2,29,249,22,85,23,202, +2,194,249,22,71,248,22,183,13,23,197,1,194,87,94,23,193,1,28,249,22, +169,7,23,196,2,2,29,249,22,85,23,200,2,9,249,22,71,248,22,183,13, +23,197,1,9,28,249,22,169,7,23,196,2,2,29,249,22,85,197,194,87,94, +23,196,1,249,22,71,248,22,183,13,23,197,1,194,87,94,23,193,1,28,249, +22,169,7,23,198,2,2,29,249,22,85,195,9,87,94,23,194,1,249,22,71, +248,22,183,13,23,199,1,9,87,95,28,28,248,22,163,7,194,10,248,22,175, +6,194,12,250,22,151,9,2,14,6,21,21,98,121,116,101,32,115,116,114,105, 110,103,32,111,114,32,115,116,114,105,110,103,196,28,28,248,22,80,195,249,22, -4,22,170,13,196,11,12,250,22,147,9,2,14,6,13,13,108,105,115,116,32, -111,102,32,112,97,116,104,115,197,250,2,51,197,195,28,248,22,171,6,197,248, -22,182,7,197,196,32,54,89,162,8,44,39,53,70,102,111,117,110,100,45,101, +4,22,174,13,196,11,12,250,22,151,9,2,14,6,13,13,108,105,115,116,32, +111,102,32,112,97,116,104,115,197,250,2,51,197,195,28,248,22,175,6,197,248, +22,186,7,197,196,32,54,89,162,8,44,39,53,70,102,111,117,110,100,45,101, 120,101,99,222,33,57,32,55,89,162,8,44,40,58,64,110,101,120,116,222,33, -56,27,248,22,132,14,23,196,2,28,249,22,179,8,23,195,2,23,197,1,11, -28,248,22,128,14,23,194,2,27,249,22,188,13,23,197,1,23,196,1,28,23, -197,2,91,159,39,11,90,161,39,36,11,248,22,191,13,23,197,2,87,95,23, -195,1,23,194,1,27,28,23,202,2,27,248,22,132,14,23,199,2,28,249,22, -179,8,23,195,2,23,200,2,11,28,248,22,128,14,23,194,2,250,2,54,23, -205,2,23,206,2,249,22,188,13,23,200,2,23,198,1,250,2,54,23,205,2, +56,27,248,22,136,14,23,196,2,28,249,22,183,8,23,195,2,23,197,1,11, +28,248,22,132,14,23,194,2,27,249,22,128,14,23,197,1,23,196,1,28,23, +197,2,91,159,39,11,90,161,39,36,11,248,22,131,14,23,197,2,87,95,23, +195,1,23,194,1,27,28,23,202,2,27,248,22,136,14,23,199,2,28,249,22, +183,8,23,195,2,23,200,2,11,28,248,22,132,14,23,194,2,250,2,54,23, +205,2,23,206,2,249,22,128,14,23,200,2,23,198,1,250,2,54,23,205,2, 23,206,2,23,196,1,11,28,23,193,2,192,87,94,23,193,1,27,28,248,22, -170,13,23,196,2,27,249,22,188,13,23,198,2,23,205,2,28,28,248,22,183, -13,193,10,248,22,182,13,193,192,11,11,28,23,193,2,192,87,94,23,193,1, -28,23,203,2,11,27,248,22,132,14,23,200,2,28,249,22,179,8,23,195,2, -23,201,1,11,28,248,22,128,14,23,194,2,250,2,54,23,206,1,23,207,1, -249,22,188,13,23,201,1,23,198,1,250,2,54,205,206,195,192,87,94,23,194, -1,28,23,196,2,91,159,39,11,90,161,39,36,11,248,22,191,13,23,197,2, -87,95,23,195,1,23,194,1,27,28,23,201,2,27,248,22,132,14,23,199,2, -28,249,22,179,8,23,195,2,23,200,2,11,28,248,22,128,14,23,194,2,250, -2,54,23,204,2,23,205,2,249,22,188,13,23,200,2,23,198,1,250,2,54, +174,13,23,196,2,27,249,22,128,14,23,198,2,23,205,2,28,28,248,22,187, +13,193,10,248,22,186,13,193,192,11,11,28,23,193,2,192,87,94,23,193,1, +28,23,203,2,11,27,248,22,136,14,23,200,2,28,249,22,183,8,23,195,2, +23,201,1,11,28,248,22,132,14,23,194,2,250,2,54,23,206,1,23,207,1, +249,22,128,14,23,201,1,23,198,1,250,2,54,205,206,195,192,87,94,23,194, +1,28,23,196,2,91,159,39,11,90,161,39,36,11,248,22,131,14,23,197,2, +87,95,23,195,1,23,194,1,27,28,23,201,2,27,248,22,136,14,23,199,2, +28,249,22,183,8,23,195,2,23,200,2,11,28,248,22,132,14,23,194,2,250, +2,54,23,204,2,23,205,2,249,22,128,14,23,200,2,23,198,1,250,2,54, 23,204,2,23,205,2,23,196,1,11,28,23,193,2,192,87,94,23,193,1,27, -28,248,22,170,13,23,196,2,27,249,22,188,13,23,198,2,23,204,2,28,28, -248,22,183,13,193,10,248,22,182,13,193,192,11,11,28,23,193,2,192,87,94, -23,193,1,28,23,202,2,11,27,248,22,132,14,23,200,2,28,249,22,179,8, -23,195,2,23,201,1,11,28,248,22,128,14,23,194,2,250,2,54,23,205,1, -23,206,1,249,22,188,13,23,201,1,23,198,1,250,2,54,204,205,195,192,28, -23,193,2,91,159,39,11,90,161,39,36,11,248,22,191,13,23,199,2,87,95, +28,248,22,174,13,23,196,2,27,249,22,128,14,23,198,2,23,204,2,28,28, +248,22,187,13,193,10,248,22,186,13,193,192,11,11,28,23,193,2,192,87,94, +23,193,1,28,23,202,2,11,27,248,22,136,14,23,200,2,28,249,22,183,8, +23,195,2,23,201,1,11,28,248,22,132,14,23,194,2,250,2,54,23,205,1, +23,206,1,249,22,128,14,23,201,1,23,198,1,250,2,54,204,205,195,192,28, +23,193,2,91,159,39,11,90,161,39,36,11,248,22,131,14,23,199,2,87,95, 23,195,1,23,194,1,27,28,23,198,2,251,2,55,23,198,2,23,203,2,23, -201,2,23,202,2,11,28,23,193,2,192,87,94,23,193,1,27,28,248,22,170, -13,195,27,249,22,188,13,197,200,28,28,248,22,183,13,193,10,248,22,182,13, +201,2,23,202,2,11,28,23,193,2,192,87,94,23,193,1,27,28,248,22,174, +13,195,27,249,22,128,14,197,200,28,28,248,22,187,13,193,10,248,22,186,13, 193,192,11,11,28,192,192,28,198,11,251,2,55,198,203,201,202,194,32,58,89, 162,8,44,40,8,31,2,19,222,33,59,28,248,22,79,23,197,2,11,27,248, -22,131,14,248,22,72,23,199,2,27,249,22,188,13,23,196,1,23,197,2,28, -248,22,182,13,23,194,2,250,2,54,198,199,195,87,94,23,193,1,27,248,22, -73,23,200,1,28,248,22,79,23,194,2,11,27,248,22,131,14,248,22,72,23, -196,2,27,249,22,188,13,23,196,1,23,200,2,28,248,22,182,13,23,194,2, +22,135,14,248,22,72,23,199,2,27,249,22,128,14,23,196,1,23,197,2,28, +248,22,186,13,23,194,2,250,2,54,198,199,195,87,94,23,193,1,27,248,22, +73,23,200,1,28,248,22,79,23,194,2,11,27,248,22,135,14,248,22,72,23, +196,2,27,249,22,128,14,23,196,1,23,200,2,28,248,22,186,13,23,194,2, 250,2,54,201,202,195,87,94,23,193,1,27,248,22,73,23,197,1,28,248,22, -79,23,194,2,11,27,248,22,131,14,248,22,72,23,196,2,27,249,22,188,13, -23,196,1,23,203,2,28,248,22,182,13,23,194,2,250,2,54,204,205,195,87, +79,23,194,2,11,27,248,22,135,14,248,22,72,23,196,2,27,249,22,128,14, +23,196,1,23,203,2,28,248,22,186,13,23,194,2,250,2,54,204,205,195,87, 94,23,193,1,27,248,22,73,23,197,1,28,248,22,79,23,194,2,11,27,248, -22,131,14,248,22,72,23,196,2,27,249,22,188,13,23,196,1,23,206,2,28, -248,22,182,13,23,194,2,250,2,54,23,15,23,16,195,87,94,23,193,1,27, -248,22,73,23,197,1,28,248,22,79,23,194,2,11,27,248,22,131,14,248,22, -72,23,196,2,27,249,22,188,13,23,196,1,23,209,2,28,248,22,182,13,23, +22,135,14,248,22,72,23,196,2,27,249,22,128,14,23,196,1,23,206,2,28, +248,22,186,13,23,194,2,250,2,54,23,15,23,16,195,87,94,23,193,1,27, +248,22,73,23,197,1,28,248,22,79,23,194,2,11,27,248,22,135,14,248,22, +72,23,196,2,27,249,22,128,14,23,196,1,23,209,2,28,248,22,186,13,23, 194,2,250,2,54,23,18,23,19,195,87,94,23,193,1,27,248,22,73,23,197, -1,28,248,22,79,23,194,2,11,27,248,22,131,14,248,22,72,195,27,249,22, -188,13,23,196,1,23,19,28,248,22,182,13,193,250,2,54,23,21,23,22,195, -251,2,58,23,21,23,22,23,23,248,22,73,199,87,95,28,28,248,22,170,13, -23,195,2,10,28,248,22,171,6,23,195,2,28,248,22,128,14,23,195,2,10, -248,22,129,14,23,195,2,11,12,250,22,147,9,2,15,6,25,25,112,97,116, +1,28,248,22,79,23,194,2,11,27,248,22,135,14,248,22,72,195,27,249,22, +128,14,23,196,1,23,19,28,248,22,186,13,193,250,2,54,23,21,23,22,195, +251,2,58,23,21,23,22,23,23,248,22,73,199,87,95,28,28,248,22,174,13, +23,195,2,10,28,248,22,175,6,23,195,2,28,248,22,132,14,23,195,2,10, +248,22,133,14,23,195,2,11,12,250,22,151,9,2,15,6,25,25,112,97,116, 104,32,111,114,32,115,116,114,105,110,103,32,40,115,97,110,115,32,110,117,108, -41,23,197,2,28,28,23,195,2,28,28,248,22,170,13,23,196,2,10,28,248, -22,171,6,23,196,2,28,248,22,128,14,23,196,2,10,248,22,129,14,23,196, -2,11,248,22,128,14,23,196,2,11,10,12,250,22,147,9,2,15,6,29,29, +41,23,197,2,28,28,23,195,2,28,28,248,22,174,13,23,196,2,10,28,248, +22,175,6,23,196,2,28,248,22,132,14,23,196,2,10,248,22,133,14,23,196, +2,11,248,22,132,14,23,196,2,11,10,12,250,22,151,9,2,15,6,29,29, 35,102,32,111,114,32,114,101,108,97,116,105,118,101,32,112,97,116,104,32,111, -114,32,115,116,114,105,110,103,23,198,2,28,28,248,22,128,14,23,195,2,91, -159,39,11,90,161,39,36,11,248,22,191,13,23,198,2,249,22,177,8,194,68, -114,101,108,97,116,105,118,101,11,27,248,22,188,7,6,4,4,80,65,84,72, -27,28,23,194,2,27,249,80,159,41,48,38,23,197,1,9,28,249,22,177,8, -247,22,190,7,2,21,249,22,71,248,22,179,13,5,1,46,194,192,87,94,23, -194,1,9,28,248,22,79,23,194,2,11,27,248,22,131,14,248,22,72,23,196, -2,27,249,22,188,13,23,196,1,23,200,2,28,248,22,182,13,23,194,2,250, +114,32,115,116,114,105,110,103,23,198,2,28,28,248,22,132,14,23,195,2,91, +159,39,11,90,161,39,36,11,248,22,131,14,23,198,2,249,22,181,8,194,68, +114,101,108,97,116,105,118,101,11,27,248,22,128,8,6,4,4,80,65,84,72, +27,28,23,194,2,27,249,80,159,41,48,38,23,197,1,9,28,249,22,181,8, +247,22,130,8,2,21,249,22,71,248,22,183,13,5,1,46,194,192,87,94,23, +194,1,9,28,248,22,79,23,194,2,11,27,248,22,135,14,248,22,72,23,196, +2,27,249,22,128,14,23,196,1,23,200,2,28,248,22,186,13,23,194,2,250, 2,54,201,202,195,87,94,23,193,1,27,248,22,73,23,197,1,28,248,22,79, -23,194,2,11,27,248,22,131,14,248,22,72,23,196,2,27,249,22,188,13,23, -196,1,23,203,2,28,248,22,182,13,23,194,2,250,2,54,204,205,195,87,94, +23,194,2,11,27,248,22,135,14,248,22,72,23,196,2,27,249,22,128,14,23, +196,1,23,203,2,28,248,22,186,13,23,194,2,250,2,54,204,205,195,87,94, 23,193,1,27,248,22,73,23,197,1,28,248,22,79,23,194,2,11,27,248,22, -131,14,248,22,72,195,27,249,22,188,13,23,196,1,205,28,248,22,182,13,193, +135,14,248,22,72,195,27,249,22,128,14,23,196,1,205,28,248,22,186,13,193, 250,2,54,23,15,23,16,195,251,2,58,23,15,23,16,23,17,248,22,73,199, -27,248,22,131,14,23,196,1,28,248,22,182,13,193,250,2,54,198,199,195,11, +27,248,22,135,14,23,196,1,28,248,22,186,13,193,250,2,54,198,199,195,11, 250,80,159,39,49,37,196,197,11,250,80,159,39,49,37,196,11,11,87,94,249, -22,162,6,247,22,134,5,195,248,22,188,5,249,22,180,3,36,249,22,164,3, +22,166,6,247,22,138,5,195,248,22,128,6,249,22,184,3,36,249,22,168,3, 197,198,27,28,23,197,2,87,95,23,196,1,23,195,1,23,197,1,87,94,23, -197,1,27,248,22,146,14,2,20,27,249,80,159,41,49,37,23,196,1,11,27, -27,248,22,183,3,23,200,1,28,192,192,36,27,27,248,22,183,3,23,202,1, -28,192,192,36,249,22,165,5,23,197,1,83,158,40,20,100,95,89,162,8,44, -36,48,9,224,3,2,33,63,23,195,1,23,196,1,27,248,22,150,5,23,195, +197,1,27,248,22,150,14,2,20,27,249,80,159,41,49,37,23,196,1,11,27, +27,248,22,187,3,23,200,1,28,192,192,36,27,27,248,22,187,3,23,202,1, +28,192,192,36,249,22,169,5,23,197,1,83,158,40,20,100,95,89,162,8,44, +36,48,9,224,3,2,33,63,23,195,1,23,196,1,27,248,22,154,5,23,195, 1,248,80,159,39,54,37,193,159,36,20,105,159,36,16,1,11,16,0,83,158, 42,20,103,145,2,1,2,1,29,11,11,11,11,11,10,43,80,158,36,36,20, 105,159,38,16,17,2,2,2,3,2,4,2,5,2,6,2,7,2,8,2,9, @@ -375,7 +375,7 @@ 16,2,89,162,8,44,37,51,2,19,223,0,33,30,80,159,36,54,37,83,158, 36,16,2,89,162,8,44,37,56,2,19,223,0,33,31,80,159,36,53,37,83, 158,36,16,2,32,0,89,162,44,37,45,2,2,222,33,32,80,159,36,36,37, -83,158,36,16,2,249,22,173,6,7,92,7,92,80,159,36,37,37,83,158,36, +83,158,36,16,2,249,22,177,6,7,92,7,92,80,159,36,37,37,83,158,36, 16,2,89,162,44,37,54,2,4,223,0,33,33,80,159,36,38,37,83,158,36, 16,2,32,0,89,162,8,44,38,50,2,5,222,33,34,80,159,36,39,37,83, 158,36,16,2,32,0,89,162,8,44,39,51,2,6,222,33,36,80,159,36,40, @@ -388,8 +388,8 @@ 222,33,47,80,159,36,46,37,83,158,36,16,2,83,158,39,20,99,96,2,13, 89,162,44,36,44,9,223,0,33,48,89,162,44,37,45,9,223,0,33,49,89, 162,44,38,55,9,223,0,33,50,80,159,36,47,37,83,158,36,16,2,27,248, -22,153,14,248,22,182,7,27,28,249,22,177,8,247,22,190,7,2,21,6,1, -1,59,6,1,1,58,250,22,155,7,6,14,14,40,91,94,126,97,93,42,41, +22,157,14,248,22,186,7,27,28,249,22,181,8,247,22,130,8,2,21,6,1, +1,59,6,1,1,58,250,22,159,7,6,14,14,40,91,94,126,97,93,42,41, 126,97,40,46,42,41,23,196,2,23,196,1,89,162,8,44,38,48,2,14,223, 0,33,53,80,159,36,48,37,83,158,36,16,2,83,158,39,20,99,96,2,15, 89,162,8,44,39,8,24,9,223,0,33,60,89,162,44,38,47,9,223,0,33, @@ -400,13 +400,13 @@ EVAL_ONE_SIZED_STR((char *)expr, 6246); } { - SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,48,9,0,0,0,1,0,0,10,0,16, + SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,49,9,0,0,0,1,0,0,10,0,16, 0,29,0,44,0,58,0,72,0,86,0,128,0,0,0,57,1,0,0,69,35, 37,98,117,105,108,116,105,110,65,113,117,111,116,101,29,94,2,2,67,35,37, 117,116,105,108,115,11,29,94,2,2,69,35,37,110,101,116,119,111,114,107,11, 29,94,2,2,68,35,37,112,97,114,97,109,122,11,29,94,2,2,68,35,37, 101,120,112,111,98,115,11,29,94,2,2,68,35,37,107,101,114,110,101,108,11, -97,36,11,8,240,215,77,0,0,98,159,2,3,36,36,159,2,4,36,36,159, +97,36,11,8,240,33,79,0,0,98,159,2,3,36,36,159,2,4,36,36,159, 2,5,36,36,159,2,6,36,36,159,2,7,36,36,159,2,7,36,36,16,0, 159,36,20,105,159,36,16,1,11,16,0,83,158,42,20,103,145,2,1,2,1, 29,11,11,11,11,11,18,96,11,44,44,44,36,80,158,36,36,20,105,159,36, @@ -420,7 +420,7 @@ EVAL_ONE_SIZED_STR((char *)expr, 353); } { - SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,48,74,0,0,0,1,0,0,7,0,18, + SHARED_OK static MZCOMPILED_STRING_FAR unsigned char expr[] = {35,126,8,52,46,50,46,53,46,49,49,74,0,0,0,1,0,0,7,0,18, 0,45,0,51,0,64,0,73,0,80,0,102,0,124,0,150,0,162,0,180,0, 200,0,212,0,228,0,251,0,7,1,38,1,45,1,50,1,55,1,60,1,65, 1,70,1,79,1,84,1,88,1,94,1,101,1,107,1,115,1,124,1,145,1, @@ -446,97 +446,97 @@ 97,109,101,5,3,46,122,111,5,3,46,122,111,6,6,6,110,97,116,105,118, 101,64,108,111,111,112,63,108,105,98,6,3,3,46,115,115,6,4,4,46,114, 107,116,5,4,46,114,107,116,67,105,103,110,111,114,101,100,249,22,14,195,80, -159,38,46,38,250,22,188,13,23,197,1,23,199,1,249,80,159,43,39,38,23, -198,1,2,23,250,22,188,13,23,197,1,23,199,1,249,80,159,43,39,38,23, -198,1,2,24,252,22,188,13,23,199,1,23,201,1,2,25,247,22,191,7,249, -80,159,45,39,38,23,200,1,80,159,45,36,38,252,22,188,13,23,199,1,23, -201,1,2,25,247,22,191,7,249,80,159,45,39,38,23,200,1,80,159,45,36, -38,27,252,22,188,13,23,200,1,23,202,1,2,25,247,22,191,7,249,80,159, -46,39,38,23,201,1,80,159,46,36,38,27,250,22,141,14,196,11,32,0,89, -162,8,44,36,41,9,222,11,28,192,249,22,71,195,194,11,27,252,22,188,13, -23,200,1,23,202,1,2,25,247,22,191,7,249,80,159,46,39,38,23,201,1, -80,159,46,36,38,27,250,22,141,14,196,11,32,0,89,162,8,44,36,41,9, -222,11,28,192,249,22,71,195,194,11,27,250,22,188,13,23,198,1,23,200,1, -249,80,159,44,39,38,23,199,1,2,23,27,250,22,141,14,196,11,32,0,89, -162,8,44,36,41,9,222,11,28,192,249,22,71,195,194,11,27,250,22,188,13, -23,198,1,23,200,1,249,80,159,44,39,38,23,199,1,2,24,27,250,22,141, +159,38,46,38,250,22,128,14,23,197,1,23,199,1,249,80,159,43,39,38,23, +198,1,2,23,250,22,128,14,23,197,1,23,199,1,249,80,159,43,39,38,23, +198,1,2,24,252,22,128,14,23,199,1,23,201,1,2,25,247,22,131,8,249, +80,159,45,39,38,23,200,1,80,159,45,36,38,252,22,128,14,23,199,1,23, +201,1,2,25,247,22,131,8,249,80,159,45,39,38,23,200,1,80,159,45,36, +38,27,252,22,128,14,23,200,1,23,202,1,2,25,247,22,131,8,249,80,159, +46,39,38,23,201,1,80,159,46,36,38,27,250,22,145,14,196,11,32,0,89, +162,8,44,36,41,9,222,11,28,192,249,22,71,195,194,11,27,252,22,128,14, +23,200,1,23,202,1,2,25,247,22,131,8,249,80,159,46,39,38,23,201,1, +80,159,46,36,38,27,250,22,145,14,196,11,32,0,89,162,8,44,36,41,9, +222,11,28,192,249,22,71,195,194,11,27,250,22,128,14,23,198,1,23,200,1, +249,80,159,44,39,38,23,199,1,2,23,27,250,22,145,14,196,11,32,0,89, +162,8,44,36,41,9,222,11,28,192,249,22,71,195,194,11,27,250,22,128,14, +23,198,1,23,200,1,249,80,159,44,39,38,23,199,1,2,24,27,250,22,145, 14,196,11,32,0,89,162,8,44,36,41,9,222,11,28,192,249,22,71,195,194, -11,87,94,28,248,80,159,37,38,38,23,195,2,12,250,22,147,9,77,108,111, +11,87,94,28,248,80,159,37,38,38,23,195,2,12,250,22,151,9,77,108,111, 97,100,47,117,115,101,45,99,111,109,112,105,108,101,100,6,25,25,112,97,116, 104,32,111,114,32,118,97,108,105,100,45,112,97,116,104,32,115,116,114,105,110, -103,23,197,2,91,159,46,11,90,161,37,36,11,28,248,22,130,14,23,205,2, -23,204,2,27,247,22,139,5,28,23,193,2,249,22,131,14,23,207,2,23,195, -1,23,205,2,90,161,39,37,11,248,22,191,13,23,205,1,87,94,23,196,1, -90,161,38,40,11,28,23,205,2,27,248,22,175,13,23,197,2,27,248,22,162, -7,23,195,2,28,28,249,22,176,3,23,195,2,40,249,22,165,7,5,4,46, -114,107,116,249,22,168,7,23,198,2,249,22,164,3,23,199,2,40,11,249,22, -7,23,199,2,248,22,179,13,249,22,169,7,250,22,168,7,23,202,1,36,249, -22,164,3,23,203,1,40,5,3,46,115,115,249,22,7,23,199,2,11,249,22, -7,23,197,2,11,90,161,37,42,11,28,249,22,177,8,23,199,2,23,197,2, -23,193,2,249,22,188,13,23,196,2,23,199,2,90,161,37,43,11,28,23,198, -2,28,249,22,177,8,23,200,2,23,197,1,23,193,1,87,94,23,193,1,249, -22,188,13,23,196,2,23,200,2,87,94,23,195,1,11,90,161,37,44,11,28, -249,22,177,8,23,196,2,68,114,101,108,97,116,105,118,101,87,94,23,194,1, -2,22,23,194,1,90,161,37,45,11,247,22,149,14,27,27,250,22,141,14,23, +103,23,197,2,91,159,46,11,90,161,37,36,11,28,248,22,134,14,23,205,2, +23,204,2,27,247,22,143,5,28,23,193,2,249,22,135,14,23,207,2,23,195, +1,23,205,2,90,161,39,37,11,248,22,131,14,23,205,1,87,94,23,196,1, +90,161,38,40,11,28,23,205,2,27,248,22,179,13,23,197,2,27,248,22,166, +7,23,195,2,28,28,249,22,180,3,23,195,2,40,249,22,169,7,5,4,46, +114,107,116,249,22,172,7,23,198,2,249,22,168,3,23,199,2,40,11,249,22, +7,23,199,2,248,22,183,13,249,22,173,7,250,22,172,7,23,202,1,36,249, +22,168,3,23,203,1,40,5,3,46,115,115,249,22,7,23,199,2,11,249,22, +7,23,197,2,11,90,161,37,42,11,28,249,22,181,8,23,199,2,23,197,2, +23,193,2,249,22,128,14,23,196,2,23,199,2,90,161,37,43,11,28,23,198, +2,28,249,22,181,8,23,200,2,23,197,1,23,193,1,87,94,23,193,1,249, +22,128,14,23,196,2,23,200,2,87,94,23,195,1,11,90,161,37,44,11,28, +249,22,181,8,23,196,2,68,114,101,108,97,116,105,118,101,87,94,23,194,1, +2,22,23,194,1,90,161,37,45,11,247,22,153,14,27,27,250,22,145,14,23, 204,2,11,32,0,89,162,8,44,36,41,9,222,11,28,192,249,22,71,23,203, -2,194,11,27,28,23,202,2,28,23,194,2,11,27,250,22,141,14,23,206,2, +2,194,11,27,28,23,202,2,28,23,194,2,11,27,250,22,145,14,23,206,2, 11,32,0,89,162,8,44,36,41,9,222,11,28,192,249,22,71,23,205,2,194, 11,11,27,28,23,195,2,23,195,2,23,194,2,27,89,162,44,37,50,62,122, 111,225,14,12,8,33,33,27,89,162,44,37,50,66,97,108,116,45,122,111,225, 15,13,10,33,34,27,89,162,44,37,52,9,225,16,14,10,33,35,27,89,162, -44,37,52,9,225,17,15,12,33,36,27,28,23,200,2,23,200,2,248,22,175, +44,37,52,9,225,17,15,12,33,36,27,28,23,200,2,23,200,2,248,22,179, 8,23,200,2,27,28,23,207,2,28,23,200,2,87,94,23,201,1,23,200,2, -248,22,175,8,23,202,1,11,27,28,23,195,2,28,23,197,1,27,249,22,5, +248,22,179,8,23,202,1,11,27,28,23,195,2,28,23,197,1,27,249,22,5, 89,162,8,44,37,53,9,225,23,21,17,33,37,23,215,2,27,28,23,202,2, -11,193,28,192,192,28,193,28,23,202,2,28,249,22,176,3,248,22,73,196,248, +11,193,28,192,192,28,193,28,23,202,2,28,249,22,180,3,248,22,73,196,248, 22,73,23,205,2,193,11,11,11,11,87,94,23,197,1,11,28,23,193,2,87, 105,23,212,1,23,210,1,23,209,1,23,208,1,23,207,1,23,201,1,23,200, 1,23,199,1,23,198,1,23,196,1,23,195,1,23,194,1,20,14,159,80,159, -56,40,38,250,80,159,59,41,38,249,22,27,11,80,159,8,25,40,38,22,163, +56,40,38,250,80,159,59,41,38,249,22,27,11,80,159,8,25,40,38,22,167, 4,11,20,14,159,80,159,56,40,38,250,80,159,59,41,38,249,22,27,11,80, -159,8,25,40,38,22,139,5,28,248,22,170,13,23,215,2,23,214,1,87,94, -23,214,1,247,22,147,14,249,247,22,152,14,248,22,72,195,23,24,87,94,23, +159,8,25,40,38,22,143,5,28,248,22,174,13,23,215,2,23,214,1,87,94, +23,214,1,247,22,151,14,249,247,22,156,14,248,22,72,195,23,24,87,94,23, 193,1,27,28,23,195,2,28,23,197,1,27,249,22,5,89,162,8,44,37,53, 9,225,24,22,19,33,38,23,216,2,27,28,23,204,2,11,193,28,192,192,28, -193,28,203,28,249,22,176,3,248,22,73,196,248,22,73,206,193,11,11,11,11, +193,28,203,28,249,22,180,3,248,22,73,196,248,22,73,206,193,11,11,11,11, 87,94,23,197,1,11,28,23,193,2,87,102,23,213,1,23,210,1,23,209,1, 23,208,1,23,201,1,23,200,1,23,199,1,23,196,1,23,195,1,20,14,159, 80,159,57,40,38,250,80,159,8,24,41,38,249,22,27,11,80,159,8,26,40, -38,22,163,4,23,214,1,20,14,159,80,159,57,40,38,250,80,159,8,24,41, -38,249,22,27,11,80,159,8,26,40,38,22,139,5,28,248,22,170,13,23,216, -2,23,215,1,87,94,23,215,1,247,22,147,14,249,247,22,152,14,248,22,72, +38,22,167,4,23,214,1,20,14,159,80,159,57,40,38,250,80,159,8,24,41, +38,249,22,27,11,80,159,8,26,40,38,22,143,5,28,248,22,174,13,23,216, +2,23,215,1,87,94,23,215,1,247,22,151,14,249,247,22,156,14,248,22,72, 195,23,25,87,94,23,193,1,27,28,23,197,2,28,23,201,1,27,249,22,5, 83,158,40,20,100,94,89,162,8,44,37,51,9,225,25,23,19,33,39,23,212, 1,23,217,2,27,28,23,204,2,11,193,28,192,192,28,193,28,23,204,2,28, -249,22,176,3,248,22,73,196,248,22,73,23,207,2,193,11,11,11,87,94,23, +249,22,180,3,248,22,73,196,248,22,73,23,207,2,193,11,11,11,87,94,23, 209,1,11,87,94,23,201,1,11,28,23,193,2,87,101,23,214,1,23,212,1, 23,211,1,23,210,1,23,202,1,23,200,1,23,197,1,23,196,1,20,14,159, 80,159,58,40,38,250,80,159,8,25,41,38,249,22,27,11,80,159,8,27,40, -38,22,163,4,11,20,14,159,80,159,58,40,38,250,80,159,8,25,41,38,249, -22,27,11,80,159,8,27,40,38,22,139,5,28,248,22,170,13,23,217,2,23, -216,1,87,94,23,216,1,247,22,147,14,249,247,22,137,5,248,22,72,195,23, +38,22,167,4,11,20,14,159,80,159,58,40,38,250,80,159,8,25,41,38,249, +22,27,11,80,159,8,27,40,38,22,143,5,28,248,22,174,13,23,217,2,23, +216,1,87,94,23,216,1,247,22,151,14,249,247,22,141,5,248,22,72,195,23, 26,87,94,23,193,1,27,28,23,197,1,28,23,201,1,27,249,22,5,83,158, 40,20,100,94,89,162,8,44,37,51,9,225,26,24,21,33,40,23,214,1,23, -218,1,27,28,23,205,2,11,193,28,192,192,28,193,28,204,28,249,22,176,3, +218,1,27,28,23,205,2,11,193,28,192,192,28,193,28,204,28,249,22,180,3, 248,22,73,196,248,22,73,23,15,193,11,11,11,87,95,23,215,1,23,211,1, 11,87,94,23,201,1,11,28,23,193,2,87,95,23,212,1,23,198,1,20,14, 159,80,159,59,40,38,250,80,159,8,26,41,38,249,22,27,11,80,159,8,28, -40,38,22,163,4,23,216,1,20,14,159,80,159,59,40,38,250,80,159,8,26, -41,38,249,22,27,11,80,159,8,28,40,38,22,139,5,28,248,22,170,13,23, -218,2,23,217,1,87,94,23,217,1,247,22,147,14,249,247,22,137,5,248,22, +40,38,22,167,4,23,216,1,20,14,159,80,159,59,40,38,250,80,159,8,26, +41,38,249,22,27,11,80,159,8,28,40,38,22,143,5,28,248,22,174,13,23, +218,2,23,217,1,87,94,23,217,1,247,22,151,14,249,247,22,141,5,248,22, 72,195,23,27,87,94,23,193,1,27,28,23,199,2,87,94,23,214,1,23,213, 1,87,94,23,213,1,23,214,1,20,14,159,80,159,8,24,40,38,250,80,159, -8,27,41,38,249,22,27,11,80,159,8,29,40,38,22,163,4,28,23,29,28, +8,27,41,38,249,22,27,11,80,159,8,29,40,38,22,167,4,28,23,29,28, 23,202,1,11,195,87,94,23,202,1,11,20,14,159,80,159,8,24,40,38,250, -80,159,8,27,41,38,249,22,27,11,80,159,8,29,40,38,22,139,5,28,248, -22,170,13,23,219,2,23,218,1,87,94,23,218,1,247,22,147,14,249,247,22, -137,5,194,23,28,0,17,35,114,120,34,94,40,46,42,63,41,47,40,46,42, -41,36,34,32,43,89,162,8,44,37,59,2,26,222,33,44,27,249,22,157,14, +80,159,8,27,41,38,249,22,27,11,80,159,8,29,40,38,22,143,5,28,248, +22,174,13,23,219,2,23,218,1,87,94,23,218,1,247,22,151,14,249,247,22, +141,5,194,23,28,0,17,35,114,120,34,94,40,46,42,63,41,47,40,46,42, +41,36,34,32,43,89,162,8,44,37,59,2,26,222,33,44,27,249,22,161,14, 2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23, -196,2,27,248,22,105,23,197,1,27,249,22,157,14,2,42,23,196,2,28,23, +196,2,27,248,22,105,23,197,1,27,249,22,161,14,2,42,23,196,2,28,23, 193,2,87,94,23,194,1,249,22,71,248,22,96,23,196,2,27,248,22,105,23, -197,1,27,249,22,157,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1, -249,22,71,248,22,96,23,196,2,27,248,22,105,23,197,1,27,249,22,157,14, +197,1,27,249,22,161,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1, +249,22,71,248,22,96,23,196,2,27,248,22,105,23,197,1,27,249,22,161,14, 2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23, 196,2,248,2,43,248,22,105,23,197,1,248,22,81,194,248,22,81,194,248,22, 81,194,248,22,81,194,32,45,89,162,44,37,55,2,26,222,33,46,28,248,22, @@ -546,12 +546,12 @@ 22,79,248,22,73,23,195,2,249,22,7,9,248,22,72,195,91,159,38,11,90, 161,38,36,11,248,2,45,248,22,73,196,249,22,7,249,22,71,248,22,72,199, 196,195,249,22,7,249,22,71,248,22,72,199,196,195,249,22,7,249,22,71,248, -22,72,199,196,195,27,27,249,22,157,14,2,42,23,197,2,28,23,193,2,87, +22,72,199,196,195,27,27,249,22,161,14,2,42,23,197,2,28,23,193,2,87, 94,23,195,1,249,22,71,248,22,96,23,196,2,27,248,22,105,23,197,1,27, -249,22,157,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71, -248,22,96,23,196,2,27,248,22,105,23,197,1,27,249,22,157,14,2,42,23, +249,22,161,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71, +248,22,96,23,196,2,27,248,22,105,23,197,1,27,249,22,161,14,2,42,23, 196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23,196,2,27, -248,22,105,23,197,1,27,249,22,157,14,2,42,23,196,2,28,23,193,2,87, +248,22,105,23,197,1,27,249,22,161,14,2,42,23,196,2,28,23,193,2,87, 94,23,194,1,249,22,71,248,22,96,23,196,2,248,2,43,248,22,105,23,197, 1,248,22,81,194,248,22,81,194,248,22,81,194,248,22,81,195,28,23,195,1, 192,28,248,22,79,248,22,73,23,195,2,249,22,7,9,248,22,72,195,91,159, @@ -560,23 +560,23 @@ 73,196,28,248,22,79,248,22,73,23,195,2,249,22,7,9,248,22,72,195,91, 159,38,11,90,161,38,36,11,248,2,45,248,22,73,196,249,22,7,249,22,71, 248,22,72,199,196,195,249,22,7,249,22,71,248,22,72,199,196,195,249,22,7, -249,22,71,248,22,72,199,196,195,87,95,28,248,22,181,4,195,12,250,22,147, +249,22,71,248,22,72,199,196,195,87,95,28,248,22,185,4,195,12,250,22,151, 9,2,18,6,20,20,114,101,115,111,108,118,101,100,45,109,111,100,117,108,101, 45,112,97,116,104,197,28,24,193,2,248,24,194,1,195,87,94,23,193,1,12, -27,27,250,22,146,2,80,159,42,43,38,248,22,182,14,247,22,150,12,11,28, -23,193,2,192,87,94,23,193,1,27,247,22,130,2,87,94,250,22,144,2,80, -159,43,43,38,248,22,182,14,247,22,150,12,195,192,250,22,144,2,195,198,66, -97,116,116,97,99,104,251,211,197,198,199,10,28,192,250,22,146,9,11,196,195, -248,22,144,9,194,32,51,89,162,44,37,52,2,26,222,33,52,28,248,22,79, +27,27,250,22,150,2,80,159,42,43,38,248,22,186,14,247,22,154,12,11,28, +23,193,2,192,87,94,23,193,1,27,247,22,130,2,87,94,250,22,148,2,80, +159,43,43,38,248,22,186,14,247,22,154,12,195,192,250,22,148,2,195,198,66, +97,116,116,97,99,104,251,211,197,198,199,10,28,192,250,22,150,9,11,196,195, +248,22,148,9,194,32,51,89,162,44,37,52,2,26,222,33,52,28,248,22,79, 248,22,73,23,195,2,249,22,7,9,248,22,72,195,91,159,38,11,90,161,38, 36,11,27,248,22,73,196,28,248,22,79,248,22,73,23,195,2,249,22,7,9, 248,22,72,195,91,159,38,11,90,161,38,36,11,248,2,51,248,22,73,196,249, 22,7,249,22,71,248,22,72,199,196,195,249,22,7,249,22,71,248,22,72,199, -196,195,32,53,89,162,8,44,37,55,2,26,222,33,54,27,249,22,157,14,2, +196,195,32,53,89,162,8,44,37,55,2,26,222,33,54,27,249,22,161,14,2, 42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23,196, -2,27,248,22,105,23,197,1,27,249,22,157,14,2,42,23,196,2,28,23,193, +2,27,248,22,105,23,197,1,27,249,22,161,14,2,42,23,196,2,28,23,193, 2,87,94,23,194,1,249,22,71,248,22,96,23,196,2,27,248,22,105,23,197, -1,27,249,22,157,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249, +1,27,249,22,161,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249, 22,71,248,22,96,23,196,2,248,2,53,248,22,105,23,197,1,248,22,81,194, 248,22,81,194,248,22,81,194,32,55,89,162,44,37,52,2,26,222,33,56,28, 248,22,79,248,22,73,23,195,2,249,22,7,9,248,22,72,195,91,159,38,11, @@ -584,139 +584,139 @@ 22,7,9,248,22,72,195,91,159,38,11,90,161,38,36,11,248,2,55,248,22, 73,196,249,22,7,249,22,71,248,22,72,199,196,195,249,22,7,249,22,71,248, 22,72,199,196,195,32,57,89,162,8,44,37,55,2,26,222,33,58,27,249,22, -157,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22, -96,23,196,2,27,248,22,105,23,197,1,27,249,22,157,14,2,42,23,196,2, +161,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22, +96,23,196,2,27,248,22,105,23,197,1,27,249,22,161,14,2,42,23,196,2, 28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23,196,2,27,248,22, -105,23,197,1,27,249,22,157,14,2,42,23,196,2,28,23,193,2,87,94,23, +105,23,197,1,27,249,22,161,14,2,42,23,196,2,28,23,193,2,87,94,23, 194,1,249,22,71,248,22,96,23,196,2,248,2,57,248,22,105,23,197,1,248, -22,81,194,248,22,81,194,248,22,81,194,28,249,22,177,6,194,6,1,1,46, -2,22,28,249,22,177,6,194,6,2,2,46,46,62,117,112,192,0,11,35,114, +22,81,194,248,22,81,194,248,22,81,194,28,249,22,181,6,194,6,1,1,46, +2,22,28,249,22,181,6,194,6,2,2,46,46,62,117,112,192,0,11,35,114, 120,34,91,46,93,115,115,36,34,32,61,89,162,44,37,52,2,26,222,33,62, 28,248,22,79,248,22,73,23,195,2,249,22,7,9,248,22,72,195,91,159,38, 11,90,161,38,36,11,27,248,22,73,196,28,248,22,79,248,22,73,23,195,2, 249,22,7,9,248,22,72,195,91,159,38,11,90,161,38,36,11,248,2,61,248, 22,73,196,249,22,7,249,22,71,248,22,72,199,196,195,249,22,7,249,22,71, 248,22,72,199,196,195,32,63,89,162,8,44,37,55,2,26,222,33,64,27,249, -22,157,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248, -22,96,23,196,2,27,248,22,105,23,197,1,27,249,22,157,14,2,42,23,196, +22,161,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248, +22,96,23,196,2,27,248,22,105,23,197,1,27,249,22,161,14,2,42,23,196, 2,28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23,196,2,27,248, -22,105,23,197,1,27,249,22,157,14,2,42,23,196,2,28,23,193,2,87,94, +22,105,23,197,1,27,249,22,161,14,2,42,23,196,2,28,23,193,2,87,94, 23,194,1,249,22,71,248,22,96,23,196,2,248,2,63,248,22,105,23,197,1, 248,22,81,194,248,22,81,194,248,22,81,194,32,65,89,162,8,44,37,55,2, -26,222,33,66,27,249,22,157,14,2,42,23,196,2,28,23,193,2,87,94,23, +26,222,33,66,27,249,22,161,14,2,42,23,196,2,28,23,193,2,87,94,23, 194,1,249,22,71,248,22,96,23,196,2,27,248,22,105,23,197,1,27,249,22, -157,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22, -96,23,196,2,27,248,22,105,23,197,1,27,249,22,157,14,2,42,23,196,2, +161,14,2,42,23,196,2,28,23,193,2,87,94,23,194,1,249,22,71,248,22, +96,23,196,2,27,248,22,105,23,197,1,27,249,22,161,14,2,42,23,196,2, 28,23,193,2,87,94,23,194,1,249,22,71,248,22,96,23,196,2,248,2,65, 248,22,105,23,197,1,248,22,81,194,248,22,81,194,248,22,81,194,27,248,2, -65,23,195,1,192,28,249,22,179,8,248,22,73,23,200,2,23,197,1,28,249, -22,177,8,248,22,72,23,200,2,23,196,1,251,22,144,9,2,18,6,26,26, +65,23,195,1,192,28,249,22,183,8,248,22,73,23,200,2,23,197,1,28,249, +22,181,8,248,22,72,23,200,2,23,196,1,251,22,148,9,2,18,6,26,26, 99,121,99,108,101,32,105,110,32,108,111,97,100,105,110,103,32,97,116,32,126, 101,58,32,126,101,23,200,1,249,22,2,22,73,248,22,86,249,22,71,23,206, 1,23,202,1,12,12,247,192,20,14,159,80,159,40,45,38,249,22,71,248,22, -182,14,247,22,150,12,23,197,1,20,14,159,80,159,40,40,38,250,80,159,43, -41,38,249,22,27,11,80,159,45,40,38,22,162,4,23,196,1,249,247,22,138, -5,23,198,1,248,22,59,248,22,174,13,23,198,1,87,94,28,28,248,22,170, -13,23,196,2,10,248,22,189,4,23,196,2,12,28,23,197,2,250,22,146,9, +186,14,247,22,154,12,23,197,1,20,14,159,80,159,40,40,38,250,80,159,43, +41,38,249,22,27,11,80,159,45,40,38,22,166,4,23,196,1,249,247,22,142, +5,23,198,1,248,22,59,248,22,178,13,23,198,1,87,94,28,28,248,22,174, +13,23,196,2,10,248,22,129,5,23,196,2,12,28,23,197,2,250,22,150,9, 11,6,15,15,98,97,100,32,109,111,100,117,108,101,32,112,97,116,104,23,200, -2,250,22,147,9,2,18,6,19,19,109,111,100,117,108,101,45,112,97,116,104, +2,250,22,151,9,2,18,6,19,19,109,111,100,117,108,101,45,112,97,116,104, 32,111,114,32,112,97,116,104,23,198,2,28,28,248,22,69,23,196,2,249,22, -177,8,248,22,72,23,198,2,2,4,11,248,22,182,4,248,22,96,196,28,28, -248,22,69,23,196,2,249,22,177,8,248,22,72,23,198,2,66,112,108,97,110, +181,8,248,22,72,23,198,2,2,4,11,248,22,186,4,248,22,96,196,28,28, +248,22,69,23,196,2,249,22,181,8,248,22,72,23,198,2,66,112,108,97,110, 101,116,11,87,94,28,207,12,20,14,159,80,159,37,52,38,80,158,37,50,90, -161,37,36,10,249,22,164,4,21,94,2,27,6,19,19,112,108,97,110,101,116, +161,37,36,10,249,22,168,4,21,94,2,27,6,19,19,112,108,97,110,101,116, 47,114,101,115,111,108,118,101,114,46,114,107,116,1,27,112,108,97,110,101,116, 45,109,111,100,117,108,101,45,110,97,109,101,45,114,101,115,111,108,118,101,114, 12,252,212,199,200,201,202,80,158,42,50,87,94,23,193,1,27,89,162,8,44, 37,46,79,115,104,111,119,45,99,111,108,108,101,99,116,105,111,110,45,101,114, -114,223,5,33,50,27,28,248,22,56,23,198,2,27,250,22,146,2,80,159,43, -44,38,249,22,71,23,203,2,247,22,148,14,11,28,23,193,2,192,87,94,23, +114,223,5,33,50,27,28,248,22,56,23,198,2,27,250,22,150,2,80,159,43, +44,38,249,22,71,23,203,2,247,22,152,14,11,28,23,193,2,192,87,94,23, 193,1,91,159,38,11,90,161,38,36,11,27,248,22,62,23,202,2,248,2,51, 248,2,53,23,195,1,27,251,80,159,47,54,38,2,18,23,202,1,28,248,22, 79,23,199,2,23,199,2,248,22,72,23,199,2,28,248,22,79,23,199,2,9, -248,22,73,23,199,2,249,22,188,13,23,195,1,28,248,22,79,23,197,1,87, -94,23,197,1,6,8,8,109,97,105,110,46,114,107,116,249,22,130,7,23,199, -1,6,4,4,46,114,107,116,28,248,22,171,6,23,198,2,87,94,23,194,1, -27,27,28,23,200,2,28,249,22,177,8,23,202,2,80,158,43,47,80,158,41, -48,27,248,22,183,4,23,202,2,28,248,22,170,13,23,194,2,91,159,39,11, -90,161,39,36,11,248,22,191,13,23,197,1,87,95,83,160,38,11,80,158,45, +248,22,73,23,199,2,249,22,128,14,23,195,1,28,248,22,79,23,197,1,87, +94,23,197,1,6,8,8,109,97,105,110,46,114,107,116,249,22,134,7,23,199, +1,6,4,4,46,114,107,116,28,248,22,175,6,23,198,2,87,94,23,194,1, +27,27,28,23,200,2,28,249,22,181,8,23,202,2,80,158,43,47,80,158,41, +48,27,248,22,187,4,23,202,2,28,248,22,174,13,23,194,2,91,159,39,11, +90,161,39,36,11,248,22,131,14,23,197,1,87,95,83,160,38,11,80,158,45, 47,23,204,2,83,160,38,11,80,158,45,48,192,192,11,11,28,23,193,2,192, -87,94,23,193,1,27,247,22,139,5,28,23,193,2,192,87,94,23,193,1,247, -22,147,14,27,250,22,146,2,80,159,44,44,38,249,22,71,23,204,2,23,199, +87,94,23,193,1,27,247,22,143,5,28,23,193,2,192,87,94,23,193,1,247, +22,151,14,27,250,22,150,2,80,159,44,44,38,249,22,71,23,204,2,23,199, 2,11,28,23,193,2,192,87,94,23,193,1,91,159,38,11,90,161,38,36,11, -248,2,55,248,2,57,23,203,2,250,22,1,22,188,13,23,199,1,249,22,85, +248,2,55,248,2,57,23,203,2,250,22,1,22,128,14,23,199,1,249,22,85, 249,22,2,32,0,89,162,8,44,37,44,9,222,33,59,23,200,1,248,22,81, -27,248,22,174,6,23,202,2,28,249,22,176,3,194,39,28,249,22,177,6,2, -28,249,22,129,7,204,249,22,164,3,198,39,249,22,130,7,250,22,129,7,205, -36,249,22,164,3,199,39,2,29,200,200,28,248,22,170,13,23,198,2,87,94, -23,194,1,28,248,22,129,14,23,198,2,91,159,39,11,90,161,39,36,11,248, -22,191,13,23,201,2,87,95,23,195,1,23,193,1,28,249,22,157,14,2,60, -248,22,175,13,23,197,1,249,80,159,44,53,38,23,202,2,2,30,23,200,2, +27,248,22,178,6,23,202,2,28,249,22,180,3,194,39,28,249,22,181,6,2, +28,249,22,133,7,204,249,22,168,3,198,39,249,22,134,7,250,22,133,7,205, +36,249,22,168,3,199,39,2,29,200,200,28,248,22,174,13,23,198,2,87,94, +23,194,1,28,248,22,133,14,23,198,2,91,159,39,11,90,161,39,36,11,248, +22,131,14,23,201,2,87,95,23,195,1,23,193,1,28,249,22,161,14,2,60, +248,22,179,13,23,197,1,249,80,159,44,53,38,23,202,2,2,30,23,200,2, 248,22,81,6,26,26,32,40,97,32,112,97,116,104,32,109,117,115,116,32,98, -101,32,97,98,115,111,108,117,116,101,41,28,249,22,177,8,248,22,72,23,200, -2,2,27,27,250,22,146,2,80,159,43,44,38,249,22,71,23,203,2,247,22, -148,14,11,28,23,193,2,192,87,94,23,193,1,91,159,39,11,90,161,38,36, +101,32,97,98,115,111,108,117,116,101,41,28,249,22,181,8,248,22,72,23,200, +2,2,27,27,250,22,150,2,80,159,43,44,38,249,22,71,23,203,2,247,22, +152,14,11,28,23,193,2,192,87,94,23,193,1,91,159,39,11,90,161,38,36, 11,27,248,22,96,23,203,2,248,2,61,248,2,63,23,195,1,90,161,37,38, -11,28,248,22,79,248,22,98,23,203,2,28,248,22,79,23,194,2,249,22,161, +11,28,248,22,79,248,22,98,23,203,2,28,248,22,79,23,194,2,249,22,165, 14,0,8,35,114,120,34,91,46,93,34,23,196,2,11,10,27,27,28,23,197, 2,249,22,85,28,248,22,79,248,22,98,23,207,2,21,93,6,5,5,109,122, 108,105,98,249,22,1,22,85,249,22,2,32,0,89,162,8,44,37,44,9,222, 33,67,248,22,98,23,210,2,23,197,2,28,248,22,79,23,196,2,248,22,81, 23,197,2,23,195,2,251,80,159,49,54,38,2,18,23,204,1,248,22,72,23, -198,2,248,22,73,23,198,1,249,22,188,13,23,195,1,28,23,198,1,87,94, -23,196,1,27,248,22,174,6,23,199,2,28,249,22,176,3,194,39,28,249,22, -177,6,2,28,249,22,129,7,201,249,22,164,3,198,39,249,22,130,7,250,22, -129,7,202,36,249,22,164,3,199,39,2,29,197,197,28,248,22,79,23,197,1, -87,94,23,197,1,6,8,8,109,97,105,110,46,114,107,116,28,249,22,161,14, -0,8,35,114,120,34,91,46,93,34,23,199,2,27,248,22,174,6,23,199,2, -28,249,22,176,3,194,39,28,249,22,177,6,2,28,249,22,129,7,201,249,22, -164,3,198,39,249,22,130,7,250,22,129,7,202,36,249,22,164,3,199,39,2, -29,197,197,249,22,130,7,23,199,1,6,4,4,46,114,107,116,28,249,22,177, -8,248,22,72,23,200,2,64,102,105,108,101,27,249,22,131,14,248,22,135,14, -248,22,96,23,202,2,27,28,23,202,2,28,249,22,177,8,23,204,2,80,158, -45,47,80,158,43,48,27,248,22,183,4,23,204,2,28,248,22,170,13,23,194, -2,91,159,39,11,90,161,39,36,11,248,22,191,13,23,197,1,87,95,83,160, +198,2,248,22,73,23,198,1,249,22,128,14,23,195,1,28,23,198,1,87,94, +23,196,1,27,248,22,178,6,23,199,2,28,249,22,180,3,194,39,28,249,22, +181,6,2,28,249,22,133,7,201,249,22,168,3,198,39,249,22,134,7,250,22, +133,7,202,36,249,22,168,3,199,39,2,29,197,197,28,248,22,79,23,197,1, +87,94,23,197,1,6,8,8,109,97,105,110,46,114,107,116,28,249,22,165,14, +0,8,35,114,120,34,91,46,93,34,23,199,2,27,248,22,178,6,23,199,2, +28,249,22,180,3,194,39,28,249,22,181,6,2,28,249,22,133,7,201,249,22, +168,3,198,39,249,22,134,7,250,22,133,7,202,36,249,22,168,3,199,39,2, +29,197,197,249,22,134,7,23,199,1,6,4,4,46,114,107,116,28,249,22,181, +8,248,22,72,23,200,2,64,102,105,108,101,27,249,22,135,14,248,22,139,14, +248,22,96,23,202,2,27,28,23,202,2,28,249,22,181,8,23,204,2,80,158, +45,47,80,158,43,48,27,248,22,187,4,23,204,2,28,248,22,174,13,23,194, +2,91,159,39,11,90,161,39,36,11,248,22,131,14,23,197,1,87,95,83,160, 38,11,80,158,47,47,23,206,2,83,160,38,11,80,158,47,48,192,192,11,11, -28,23,193,2,192,87,94,23,193,1,27,247,22,139,5,28,23,193,2,192,87, -94,23,193,1,247,22,147,14,91,159,39,11,90,161,39,36,11,248,22,191,13, -23,197,2,87,95,23,195,1,23,193,1,28,249,22,157,14,2,60,248,22,175, +28,23,193,2,192,87,94,23,193,1,27,247,22,143,5,28,23,193,2,192,87, +94,23,193,1,247,22,151,14,91,159,39,11,90,161,39,36,11,248,22,131,14, +23,197,2,87,95,23,195,1,23,193,1,28,249,22,161,14,2,60,248,22,179, 13,23,197,1,249,80,159,45,53,38,23,198,1,2,30,195,12,87,94,28,28, -248,22,170,13,23,194,2,10,248,22,129,8,23,194,2,87,94,23,199,1,12, -28,23,199,2,250,22,146,9,67,114,101,113,117,105,114,101,249,22,155,7,6, +248,22,174,13,23,194,2,10,248,22,133,8,23,194,2,87,94,23,199,1,12, +28,23,199,2,250,22,150,9,67,114,101,113,117,105,114,101,249,22,159,7,6, 17,17,98,97,100,32,109,111,100,117,108,101,32,112,97,116,104,126,97,28,23, 198,2,248,22,72,23,199,2,6,0,0,23,202,1,87,94,23,199,1,250,22, -147,9,2,18,249,22,155,7,6,13,13,109,111,100,117,108,101,32,112,97,116, +151,9,2,18,249,22,159,7,6,13,13,109,111,100,117,108,101,32,112,97,116, 104,126,97,28,23,198,2,248,22,72,23,199,2,6,0,0,23,200,2,27,28, -248,22,129,8,23,195,2,249,22,134,8,23,196,2,36,249,22,133,14,248,22, -134,14,23,197,2,11,27,28,248,22,129,8,23,196,2,249,22,134,8,23,197, +248,22,133,8,23,195,2,249,22,138,8,23,196,2,36,249,22,137,14,248,22, +138,14,23,197,2,11,27,28,248,22,133,8,23,196,2,249,22,138,8,23,197, 2,37,248,80,159,42,55,38,23,195,2,91,159,39,11,90,161,39,36,11,28, -248,22,129,8,23,199,2,250,22,7,2,31,249,22,134,8,23,203,2,38,2, -31,248,22,191,13,23,198,2,87,95,23,195,1,23,193,1,27,28,248,22,129, -8,23,200,2,249,22,134,8,23,201,2,39,249,80,159,47,53,38,23,197,2, -5,0,27,28,248,22,129,8,23,201,2,249,22,134,8,23,202,2,40,248,22, -182,4,23,200,2,27,27,250,22,146,2,80,159,51,43,38,248,22,182,14,247, -22,150,12,11,28,23,193,2,192,87,94,23,193,1,27,247,22,130,2,87,94, -250,22,144,2,80,159,52,43,38,248,22,182,14,247,22,150,12,195,192,87,95, -28,23,208,1,27,250,22,146,2,23,197,2,197,11,28,23,193,1,12,87,95, +248,22,133,8,23,199,2,250,22,7,2,31,249,22,138,8,23,203,2,38,2, +31,248,22,131,14,23,198,2,87,95,23,195,1,23,193,1,27,28,248,22,133, +8,23,200,2,249,22,138,8,23,201,2,39,249,80,159,47,53,38,23,197,2, +5,0,27,28,248,22,133,8,23,201,2,249,22,138,8,23,202,2,40,248,22, +186,4,23,200,2,27,27,250,22,150,2,80,159,51,43,38,248,22,186,14,247, +22,154,12,11,28,23,193,2,192,87,94,23,193,1,27,247,22,130,2,87,94, +250,22,148,2,80,159,52,43,38,248,22,186,14,247,22,154,12,195,192,87,95, +28,23,208,1,27,250,22,150,2,23,197,2,197,11,28,23,193,1,12,87,95, 27,27,28,248,22,17,80,159,51,46,38,80,159,50,46,38,247,22,19,250,22, -25,248,22,23,23,197,2,80,159,53,45,38,23,196,1,27,248,22,182,14,247, -22,150,12,249,22,3,83,158,40,20,100,94,89,162,8,44,37,55,9,226,12, +25,248,22,23,23,197,2,80,159,53,45,38,23,196,1,27,248,22,186,14,247, +22,154,12,249,22,3,83,158,40,20,100,94,89,162,8,44,37,55,9,226,12, 11,2,3,33,68,23,195,1,23,196,1,248,28,248,22,17,80,159,50,46,38, 32,0,89,162,44,37,42,9,222,33,69,80,159,49,59,37,89,162,44,36,51, -9,227,13,9,8,4,3,33,70,250,22,144,2,23,197,1,197,10,12,28,28, -248,22,129,8,23,202,1,11,28,248,22,171,6,23,206,2,10,28,248,22,56, -23,206,2,10,28,248,22,69,23,206,2,249,22,177,8,248,22,72,23,208,2, -2,27,11,250,22,144,2,80,159,50,44,38,28,248,22,171,6,23,209,2,249, -22,71,23,210,1,27,28,23,212,2,28,249,22,177,8,23,214,2,80,158,55, -47,87,94,23,212,1,80,158,53,48,27,248,22,183,4,23,214,2,28,248,22, -170,13,23,194,2,91,159,39,11,90,161,39,36,11,248,22,191,13,23,197,1, +9,227,13,9,8,4,3,33,70,250,22,148,2,23,197,1,197,10,12,28,28, +248,22,133,8,23,202,1,11,28,248,22,175,6,23,206,2,10,28,248,22,56, +23,206,2,10,28,248,22,69,23,206,2,249,22,181,8,248,22,72,23,208,2, +2,27,11,250,22,148,2,80,159,50,44,38,28,248,22,175,6,23,209,2,249, +22,71,23,210,1,27,28,23,212,2,28,249,22,181,8,23,214,2,80,158,55, +47,87,94,23,212,1,80,158,53,48,27,248,22,187,4,23,214,2,28,248,22, +174,13,23,194,2,91,159,39,11,90,161,39,36,11,248,22,131,14,23,197,1, 87,95,83,160,38,11,80,158,57,47,23,23,83,160,38,11,80,158,57,48,192, -192,11,11,28,23,193,2,192,87,94,23,193,1,27,247,22,139,5,28,23,193, -2,192,87,94,23,193,1,247,22,147,14,249,22,71,23,210,1,247,22,148,14, -252,22,131,8,23,208,1,23,207,1,23,205,1,23,203,1,201,12,193,87,96, +192,11,11,28,23,193,2,192,87,94,23,193,1,27,247,22,143,5,28,23,193, +2,192,87,94,23,193,1,247,22,151,14,249,22,71,23,210,1,247,22,152,14, +252,22,135,8,23,208,1,23,207,1,23,205,1,23,203,1,201,12,193,87,96, 83,160,38,11,80,158,36,50,248,80,159,37,58,38,249,22,27,11,80,159,39, -52,38,248,22,161,4,80,159,37,51,38,248,22,138,5,80,159,37,37,37,248, -22,141,13,80,159,37,42,37,83,160,38,11,80,158,36,50,248,80,159,37,58, +52,38,248,22,165,4,80,159,37,51,38,248,22,142,5,80,159,37,37,37,248, +22,145,13,80,159,37,42,37,83,160,38,11,80,158,36,50,248,80,159,37,58, 38,249,22,27,11,80,159,39,52,38,159,36,20,105,159,36,16,1,11,16,0, 83,158,42,20,103,145,2,1,2,1,29,11,11,11,11,11,10,38,80,158,36, 36,20,105,159,37,16,23,2,2,2,3,30,2,5,72,112,97,116,104,45,115, @@ -733,7 +733,7 @@ 11,11,16,2,2,20,2,21,16,2,11,11,16,2,2,20,2,21,38,38,37, 11,11,11,16,0,16,0,16,0,36,36,11,11,11,11,16,0,16,0,16,0, 36,36,16,0,16,15,83,158,36,16,2,89,162,44,37,45,9,223,0,33,32, -80,159,36,59,37,83,158,36,16,2,248,22,190,7,69,115,111,45,115,117,102, +80,159,36,59,37,83,158,36,16,2,248,22,130,8,69,115,111,45,115,117,102, 102,105,120,80,159,36,36,37,83,158,36,16,2,89,162,44,38,8,37,2,3, 223,0,33,41,80,159,36,37,37,83,158,36,16,2,32,0,89,162,8,44,37, 42,2,9,222,192,80,159,36,42,37,83,158,36,16,2,247,22,133,2,80,159, diff --git a/src/racket/src/list.c b/src/racket/src/list.c index 869b8b8e8b..cac3c2e694 100644 --- a/src/racket/src/list.c +++ b/src/racket/src/list.c @@ -100,11 +100,15 @@ static Scheme_Object *make_weak_hasheqv(int argc, Scheme_Object *argv[]); static Scheme_Object *make_immutable_hash(int argc, Scheme_Object *argv[]); static Scheme_Object *make_immutable_hasheq(int argc, Scheme_Object *argv[]); static Scheme_Object *make_immutable_hasheqv(int argc, Scheme_Object *argv[]); +static Scheme_Object *direct_hash(int argc, Scheme_Object *argv[]); +static Scheme_Object *direct_hasheq(int argc, Scheme_Object *argv[]); +static Scheme_Object *direct_hasheqv(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_table_count(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_table_copy(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_p(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_eq_p(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_eqv_p(int argc, Scheme_Object *argv[]); +static Scheme_Object *hash_equal_p(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_weak_p(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_table_put_bang(int argc, Scheme_Object *argv[]); static Scheme_Object *hash_table_put(int argc, Scheme_Object *argv[]); @@ -511,6 +515,21 @@ scheme_init_list (Scheme_Env *env) "make-immutable-hasheqv", 1, 1), env); + scheme_add_global_constant("hash", + scheme_make_immed_prim(direct_hash, + "hash", + 0, -1), + env); + scheme_add_global_constant("hasheq", + scheme_make_immed_prim(direct_hasheq, + "hasheq", + 0, -1), + env); + scheme_add_global_constant("hasheqv", + scheme_make_immed_prim(direct_hasheqv, + "hasheqv", + 0, -1), + env); scheme_add_global_constant("hash?", scheme_make_folding_prim(hash_p, "hash?", @@ -526,6 +545,11 @@ scheme_init_list (Scheme_Env *env) "hash-eqv?", 1, 1, 1), env); + scheme_add_global_constant("hash-equal?", + scheme_make_folding_prim(hash_equal_p, + "hash-equal?", + 1, 1, 1), + env); scheme_add_global_constant("hash-weak?", scheme_make_folding_prim(hash_weak_p, "hash-weak?", @@ -1817,6 +1841,42 @@ static Scheme_Object *make_immutable_hasheqv(int argc, Scheme_Object *argv[]) return make_immutable_table("make-immutable-hasheqv", 2, argc, argv); } +static Scheme_Object *direct_table(const char *who, int kind, int argc, Scheme_Object *argv[]) +{ + int i; + Scheme_Hash_Tree *ht; + + if (argc & 0x1) { + scheme_arg_mismatch(who, + "key does not have a value (i.e., an odd number of arguments were provided): ", + argv[argc-1]); + return NULL; + } + + ht = scheme_make_hash_tree(kind); + + for (i = 0; i < argc; i += 2) { + ht = scheme_hash_tree_set(ht, argv[i], argv[i+1]); + } + + return (Scheme_Object *)ht; +} + +static Scheme_Object *direct_hash(int argc, Scheme_Object *argv[]) +{ + return direct_table("hash", 1, argc, argv); +} + +static Scheme_Object *direct_hasheq(int argc, Scheme_Object *argv[]) +{ + return direct_table("hasheq", 0, argc, argv); +} + +static Scheme_Object *direct_hasheqv(int argc, Scheme_Object *argv[]) +{ + return direct_table("hasheqv", 2, argc, argv); +} + Scheme_Hash_Table *scheme_make_hash_table_equal() { Scheme_Hash_Table *t; @@ -2005,6 +2065,29 @@ static Scheme_Object *hash_eqv_p(int argc, Scheme_Object *argv[]) return scheme_false; } +static Scheme_Object *hash_equal_p(int argc, Scheme_Object *argv[]) +{ + Scheme_Object *o = argv[0]; + + if (SCHEME_CHAPERONEP(o)) + o = SCHEME_CHAPERONE_VAL(o); + + if (SCHEME_HASHTP(o)) { + if (((Scheme_Hash_Table *)o)->compare == compare_equal) + return scheme_true; + } else if (SCHEME_HASHTRP(o)) { + if (SCHEME_HASHTR_FLAGS((Scheme_Hash_Tree *)o) & 0x1) + return scheme_true; + } else if (SCHEME_BUCKTP(o)) { + if (((Scheme_Bucket_Table *)o)->compare == compare_equal) + return scheme_true; + } else { + scheme_wrong_type("hash-equal?", "hash", 0, argc, argv); + } + + return scheme_false; +} + static Scheme_Object *hash_weak_p(int argc, Scheme_Object *argv[]) { Scheme_Object *o = argv[0]; diff --git a/src/racket/src/schminc.h b/src/racket/src/schminc.h index 32f1adcd73..9da6e8a4e5 100644 --- a/src/racket/src/schminc.h +++ b/src/racket/src/schminc.h @@ -13,7 +13,7 @@ #define USE_COMPILED_STARTUP 1 -#define EXPECTED_PRIM_COUNT 988 +#define EXPECTED_PRIM_COUNT 992 #define EXPECTED_UNSAFE_COUNT 65 #define EXPECTED_FLFXNUM_COUNT 53 diff --git a/src/racket/src/schvers.h b/src/racket/src/schvers.h index ce19dbda3f..5362b8bb67 100644 --- a/src/racket/src/schvers.h +++ b/src/racket/src/schvers.h @@ -13,12 +13,12 @@ consistently.) */ -#define MZSCHEME_VERSION "4.2.5.10" +#define MZSCHEME_VERSION "4.2.5.11" #define MZSCHEME_VERSION_X 4 #define MZSCHEME_VERSION_Y 2 #define MZSCHEME_VERSION_Z 5 -#define MZSCHEME_VERSION_W 10 +#define MZSCHEME_VERSION_W 11 #define MZSCHEME_VERSION_MAJOR ((MZSCHEME_VERSION_X * 100) + MZSCHEME_VERSION_Y) #define MZSCHEME_VERSION_MINOR ((MZSCHEME_VERSION_Z * 1000) + MZSCHEME_VERSION_W) From 2ded5ce2ceefdbb2cde88aa470b7237b09cfc4ab Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Fri, 23 Apr 2010 15:15:41 -0400 Subject: [PATCH 09/12] more global patterns to avoid --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6f43a4e0ae..ce6902a12e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,7 @@ # a common convenient place to set the PLTADDON directory to /add-on/ -# common backup file suffixes +# common backups, autosaves, and lock files *~ +\#* +.#* From 8dc93d9877709b3d0ff5852c1ef139c3e62c3e19 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 23 Apr 2010 14:55:13 -0500 Subject: [PATCH 10/12] Fixed check syntax so it deals with the .rkt and .ss conflation properly --- collects/drscheme/syncheck.ss | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/collects/drscheme/syncheck.ss b/collects/drscheme/syncheck.ss index 2841cc8c6e..09c7ad29db 100644 --- a/collects/drscheme/syncheck.ss +++ b/collects/drscheme/syncheck.ss @@ -2276,16 +2276,28 @@ If the namespace does not, they are colored the unbound color. (parameterize ([current-namespace user-namespace] [current-directory user-directory] [current-load-relative-directory user-directory]) - (let ([ans (with-handlers ([exn:fail? (λ (x) #f)]) - (cond - [(module-path-index? datum) - (resolved-module-path-name - (module-path-index-resolve datum))] - [else - (resolved-module-path-name - ((current-module-name-resolver) datum #f #f))]))]) - (and (path? ans) - ans)))) + (let* ([rkt-path/mod-path + (with-handlers ([exn:fail? (λ (x) #f)]) + (cond + [(module-path-index? datum) + (resolved-module-path-name + (module-path-index-resolve datum))] + [else + (resolved-module-path-name + ((current-module-name-resolver) datum #f #f))]))] + [rkt-path/f (and (path? rkt-path/mod-path) rkt-path/mod-path)]) + (let/ec k + (unless (path? rkt-path/f) (k rkt-path/f)) + (when (file-exists? rkt-path/f) (k rkt-path/f)) + (let* ([bts (path->bytes rkt-path/f)] + [len (bytes-length bts)]) + (unless (and (len . >= . 4) + (bytes=? #".rkt" (subbytes bts (- len 4)))) + (k rkt-path/f)) + (let ([ss-path (bytes->path (bytes-append (subbytes bts 0 (- len 4)) #".ss"))]) + (unless (file-exists? ss-path) + (k rkt-path/f)) + ss-path)))))) ;; make-require-open-menu : path -> menu -> void (define (make-require-open-menu file) From 6272d0511a2d9bd82671fbfbe7268d9730c30431 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 23 Apr 2010 15:43:57 -0500 Subject: [PATCH 11/12] dont bother running collects/help/help.ss --- collects/meta/props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) mode change 100755 => 100644 collects/meta/props diff --git a/collects/meta/props b/collects/meta/props old mode 100755 new mode 100644 index 3a1d407212..db0efc4fa0 --- a/collects/meta/props +++ b/collects/meta/props @@ -812,6 +812,7 @@ path/s is either such a string or a list of them. "collects/handin-server/web-status-server.ss" drdr:command-line "mzc ~s" "collects/help" responsible (robby) "collects/help/bug-report.ss" drdr:command-line "mred-text -t ~s" +"collects/help/help.ss" drdr:command-line "mzc ~s" "collects/hierlist/hierlist.ss" drdr:command-line "mred-text -t ~s" "collects/honu" responsible (mflatt rafkind) "collects/htdp" responsible (matthias) @@ -897,8 +898,8 @@ path/s is either such a string or a list of them. "collects/make" responsible (mflatt) "collects/meta" responsible (eli) "collects/meta/check-dists.ss" drdr:command-line "" -"collects/meta/drdr" responsible (jay) drdr:command-line "" "collects/meta/contrib/completion/racket-completion.bash" responsible (samth sstrickl) drdr:command-line "" +"collects/meta/drdr" responsible (jay) drdr:command-line "" "collects/mred/edit-main.ss" drdr:command-line "mzc ~s" "collects/mred/edit.ss" drdr:command-line "mred-text -t ~s" "collects/mred/lang/main.ss" drdr:command-line "mred-text -t ~s" From 244f6e49083a75c77b48ec0d9ce6ffc621ef29af Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Fri, 23 Apr 2010 16:37:25 -0500 Subject: [PATCH 12/12] started requiring racket/ instead of scheme/ --- collects/drscheme/acks.ss | 2 +- collects/drscheme/arrow.ss | 2 +- collects/drscheme/default-code-style.ss | 4 ++-- collects/drscheme/drscheme.ss | 2 +- collects/drscheme/installer.ss | 4 ++-- collects/drscheme/main.ss | 4 ++-- collects/drscheme/private/app.ss | 6 ++---- collects/drscheme/private/bindings-browser.ss | 17 +++++++-------- collects/drscheme/private/bitmap-message.ss | 4 ++-- collects/drscheme/private/debug.ss | 14 ++++++------- collects/drscheme/private/drscheme-normal.ss | 10 ++++----- collects/drscheme/private/drsig.ss | 2 +- collects/drscheme/private/eb.ss | 6 +++--- .../drscheme/private/embedded-snip-utils.ss | 6 +++--- collects/drscheme/private/eval.ss | 12 +++++------ collects/drscheme/private/font.ss | 8 +++---- collects/drscheme/private/frame.ss | 9 ++++---- collects/drscheme/private/get-extend.ss | 2 +- collects/drscheme/private/help-desk.ss | 4 ++-- collects/drscheme/private/honu-logo.ss | 6 +++--- collects/drscheme/private/init.ss | 3 +-- .../drscheme/private/insert-large-letters.ss | 2 +- collects/drscheme/private/key.ss | 2 +- collects/drscheme/private/label-frame-mred.ss | 18 ++++++++-------- .../private/language-configuration.ss | 21 ++++++++++++------- .../private/language-object-contract.ss | 14 ++++++------- collects/drscheme/private/language.ss | 10 ++++----- .../drscheme/private/launcher-bootstrap.ss | 4 ++-- .../private/launcher-mred-bootstrap.ss | 8 +++---- .../drscheme/private/launcher-mz-bootstrap.ss | 4 ++-- collects/drscheme/private/link.ss | 2 +- collects/drscheme/private/main.ss | 2 +- collects/drscheme/private/modes.ss | 6 +++--- collects/drscheme/private/module-browser.ss | 6 +++--- .../drscheme/private/module-language-tools.ss | 8 +++---- collects/drscheme/private/module-language.ss | 14 ++++++------- .../drscheme/private/multi-file-search.ss | 4 ++-- collects/drscheme/private/number-snip.ss | 4 ++-- collects/drscheme/private/palaka.ss | 4 ++-- collects/drscheme/private/prefs-contract.ss | 4 ++-- collects/drscheme/private/profile-drs.ss | 6 +++--- collects/drscheme/private/recon.ss | 4 ++-- collects/drscheme/private/rep.ss | 12 +++++------ collects/drscheme/private/stick-figures.ss | 8 +++---- collects/drscheme/private/tools.ss | 10 ++++----- collects/drscheme/private/tracing.ss | 14 ++++++------- collects/drscheme/private/ts.ss | 3 +-- collects/drscheme/private/unit.ss | 12 +++++------ collects/drscheme/sprof.ss | 2 +- collects/drscheme/syncheck-drscheme-button.ss | 2 +- collects/drscheme/syncheck.ss | 2 +- collects/drscheme/tool-lib.ss | 2 +- collects/drscheme/tool.ss | 9 ++++---- 53 files changed, 174 insertions(+), 176 deletions(-) diff --git a/collects/drscheme/acks.ss b/collects/drscheme/acks.ss index 20fdc9e163..601afb6739 100644 --- a/collects/drscheme/acks.ss +++ b/collects/drscheme/acks.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (provide get-general-acks get-translating-acks diff --git a/collects/drscheme/arrow.ss b/collects/drscheme/arrow.ss index 3c27480bce..6cc8852bc0 100644 --- a/collects/drscheme/arrow.ss +++ b/collects/drscheme/arrow.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scheme/class scheme/math diff --git a/collects/drscheme/default-code-style.ss b/collects/drscheme/default-code-style.ss index b4ea007e2d..971c64d4bc 100644 --- a/collects/drscheme/default-code-style.ss +++ b/collects/drscheme/default-code-style.ss @@ -1,4 +1,4 @@ -(module default-code-style mzscheme +#lang racket/base (provide color-default-code-styles bw-default-code-styles code-style-color @@ -24,4 +24,4 @@ (list 'unbound-variable (make-code-style "red" #f #f #f)) (list 'bound-variable (make-code-style "navy" #f #f #f)) (list 'primitive (make-code-style "navy" #f #f #f)) - (list 'constant (make-code-style '(51 135 39) #f #f #f))))) + (list 'constant (make-code-style '(51 135 39) #f #f #f)))) diff --git a/collects/drscheme/drscheme.ss b/collects/drscheme/drscheme.ss index e5c5207b8f..fab93a1b2e 100644 --- a/collects/drscheme/drscheme.ss +++ b/collects/drscheme/drscheme.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scheme/gui/base "private/key.ss") (define debugging? (getenv "PLTDRDEBUG")) diff --git a/collects/drscheme/installer.ss b/collects/drscheme/installer.ss index 79c6c2883f..c6259165ac 100644 --- a/collects/drscheme/installer.ss +++ b/collects/drscheme/installer.ss @@ -1,4 +1,4 @@ -(module installer mzscheme +#lang racket/base (require mzlib/file mzlib/etc launcher) @@ -18,4 +18,4 @@ (mred-program-launcher-path "DrScheme") (cons `(exe-name . "DrScheme") - (build-aux-from-path (build-path (collection-path "drscheme") "drscheme"))))))) + (build-aux-from-path (build-path (collection-path "drscheme") "drscheme")))))) diff --git a/collects/drscheme/main.ss b/collects/drscheme/main.ss index f5202c93ea..1c1d394370 100644 --- a/collects/drscheme/main.ss +++ b/collects/drscheme/main.ss @@ -1,2 +1,2 @@ -(module main scheme/base - (require "drscheme.ss")) +#lang racket/base +(require "drscheme.ss") diff --git a/collects/drscheme/private/app.ss b/collects/drscheme/private/app.ss index 71c67d4822..47dff1bcbc 100644 --- a/collects/drscheme/private/app.ss +++ b/collects/drscheme/private/app.ss @@ -1,10 +1,8 @@ #lang scheme/unit -(require mzlib/class - mzlib/list - scheme/file +(require racket/class string-constants - mred + racket/gui/base framework browser/external setup/getinfo diff --git a/collects/drscheme/private/bindings-browser.ss b/collects/drscheme/private/bindings-browser.ss index 9a2b5181ef..74bae33bd5 100644 --- a/collects/drscheme/private/bindings-browser.ss +++ b/collects/drscheme/private/bindings-browser.ss @@ -1,4 +1,4 @@ -#lang mzscheme +#lang racket/base #| CODE COPIED (with permission ...) from syntax-browser.ss @@ -9,13 +9,10 @@ Marshalling (and hence the 'read' method of the snipclass omitted for fast proto |# - (require mzlib/pretty - mzlib/list - mzlib/class - mred - mzlib/match - mzlib/string - mzlib/contract) + (require racket/pretty + racket/class + racket/gui/base + racket/contract) (provide render-bindings/snip) @@ -64,7 +61,7 @@ Marshalling (and hence the 'read' method of the snipclass omitted for fast proto ; how to enrich the notion of an output-port to get 'bold'ing to ; work otherwise... (let* ([before (send output-text last-position)]) - (pretty-print (syntax-object->datum stx)) + (pretty-print (syntax->datum stx)) (let* ([post-newline (send output-text last-position)]) (send output-text delete post-newline) ; delete the trailing \n. yuck! (send output-text insert " ") @@ -164,7 +161,7 @@ Marshalling (and hence the 'read' method of the snipclass omitted for fast proto (define black-style-delta (make-object style-delta% 'change-normal-color)) (define green-style-delta (make-object style-delta%)) - (send green-style-delta set-delta-foreground "forest green") + (void (send green-style-delta set-delta-foreground "forest green")) (define turn-snip% (class snip% diff --git a/collects/drscheme/private/bitmap-message.ss b/collects/drscheme/private/bitmap-message.ss index 80c440b0f7..afa90a2c9a 100644 --- a/collects/drscheme/private/bitmap-message.ss +++ b/collects/drscheme/private/bitmap-message.ss @@ -1,6 +1,6 @@ -#lang scheme +#lang racket/base -(require mred/mred) +(require racket/gui/base racket/class) (provide bitmap-message%) (define bitmap-message% diff --git a/collects/drscheme/private/debug.ss b/collects/drscheme/private/debug.ss index a60d0c792b..10214d7789 100644 --- a/collects/drscheme/private/debug.ss +++ b/collects/drscheme/private/debug.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base #| @@ -10,11 +10,11 @@ profile todo: (require errortrace/errortrace-key scheme/unit - scheme/contract + racket/contract errortrace/stacktrace - scheme/class - scheme/path - scheme/gui/base + racket/class + racket/path + racket/gui/base string-constants framework framework/private/bday @@ -23,9 +23,9 @@ profile todo: "bindings-browser.ss" net/sendurl net/url - scheme/match + racket/match mrlib/include-bitmap - (for-syntax scheme/base)) + (for-syntax racket/base)) (define orig (current-output-port)) diff --git a/collects/drscheme/private/drscheme-normal.ss b/collects/drscheme/private/drscheme-normal.ss index 428f013005..1450eeae21 100644 --- a/collects/drscheme/private/drscheme-normal.ss +++ b/collects/drscheme/private/drscheme-normal.ss @@ -1,12 +1,12 @@ -#lang scheme/base +#lang racket/base (require mred - scheme/class - scheme/cmdline - scheme/list + racket/class + racket/cmdline + racket/list framework/private/bday framework/splash - scheme/file + racket/file "eb.ss") (define files-to-open (command-line #:args filenames filenames)) diff --git a/collects/drscheme/private/drsig.ss b/collects/drscheme/private/drsig.ss index 414fe8d8bc..a41a6860b6 100644 --- a/collects/drscheme/private/drsig.ss +++ b/collects/drscheme/private/drsig.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scheme/unit) (provide drscheme:eval^ diff --git a/collects/drscheme/private/eb.ss b/collects/drscheme/private/eb.ss index 6b74f5561f..09e3c99a93 100644 --- a/collects/drscheme/private/eb.ss +++ b/collects/drscheme/private/eb.ss @@ -1,7 +1,7 @@ -#lang scheme/base -(require scheme/class +#lang racket/base +(require racket/class framework/splash - scheme/gui/base) + racket/gui/base) (provide install-eb) (define (install-eb) diff --git a/collects/drscheme/private/embedded-snip-utils.ss b/collects/drscheme/private/embedded-snip-utils.ss index 9e96e233be..3c3dcf55a5 100644 --- a/collects/drscheme/private/embedded-snip-utils.ss +++ b/collects/drscheme/private/embedded-snip-utils.ss @@ -1,6 +1,6 @@ -#lang scheme/base -(require scheme/class - scheme/gui/base) +#lang racket/base +(require racket/class + racket/gui/base) (provide get-enclosing-editor-frame) diff --git a/collects/drscheme/private/eval.ss b/collects/drscheme/private/eval.ss index 8c55abdbb3..4cc00542d0 100644 --- a/collects/drscheme/private/eval.ss +++ b/collects/drscheme/private/eval.ss @@ -1,9 +1,9 @@ -#lang mzscheme +#lang racket/base (require mred - mzlib/unit - mzlib/port - mzlib/class + scheme/unit + racket/port + racket/class syntax/toplevel framework "drsig.ss") @@ -11,7 +11,7 @@ ;; to ensure this guy is loaded (and the snipclass installed) in the drscheme namespace & eventspace ;; these things are for effect only! (require mrlib/cache-image-snip - (prefix image-core: mrlib/image-core)) + (prefix-in image-core: mrlib/image-core)) (define op (current-output-port)) (define (oprintf . args) (apply fprintf op args)) @@ -173,7 +173,7 @@ (error-print-width 250) (current-ps-setup (make-object ps-setup%)) - (current-namespace (make-namespace 'empty)) + (current-namespace (make-empty-namespace)) (for-each (λ (x) (namespace-attach-module drscheme:init:system-namespace x)) to-be-copied-module-names)) diff --git a/collects/drscheme/private/font.ss b/collects/drscheme/private/font.ss index aa2dc23a8d..0428a5b698 100644 --- a/collects/drscheme/private/font.ss +++ b/collects/drscheme/private/font.ss @@ -1,8 +1,8 @@ -#lang mzscheme - (require mzlib/unit - mzlib/class +#lang racket/base + (require scheme/unit + racket/class + racket/gui/base "drsig.ss" - mred framework string-constants) diff --git a/collects/drscheme/private/frame.ss b/collects/drscheme/private/frame.ss index 30f5f6c471..c55512116f 100644 --- a/collects/drscheme/private/frame.ss +++ b/collects/drscheme/private/frame.ss @@ -1,9 +1,8 @@ #lang scheme/unit (require string-constants - mzlib/match - mzlib/class - mzlib/string - mzlib/list + racket/match + racket/class + racket/string "drsig.ss" mred framework @@ -11,7 +10,7 @@ net/head setup/plt-installer help/bug-report - scheme/file) + racket/file) (import [prefix drscheme:unit: drscheme:unit^] [prefix drscheme:app: drscheme:app^] diff --git a/collects/drscheme/private/get-extend.ss b/collects/drscheme/private/get-extend.ss index d0d492fac7..67e877d9f6 100644 --- a/collects/drscheme/private/get-extend.ss +++ b/collects/drscheme/private/get-extend.ss @@ -1,6 +1,6 @@ #lang scheme/unit -(require scheme/class +(require racket/class "drsig.ss") (import [prefix drscheme:unit: drscheme:unit^] diff --git a/collects/drscheme/private/help-desk.ss b/collects/drscheme/private/help-desk.ss index af8be7a308..cc1f6c5c1b 100644 --- a/collects/drscheme/private/help-desk.ss +++ b/collects/drscheme/private/help-desk.ss @@ -1,9 +1,9 @@ #lang scheme/unit -(require scheme/gui/base +(require racket/gui/base browser/external framework - scheme/class + racket/class net/url setup/dirs help/search diff --git a/collects/drscheme/private/honu-logo.ss b/collects/drscheme/private/honu-logo.ss index a60e3afa7c..6c36990c16 100644 --- a/collects/drscheme/private/honu-logo.ss +++ b/collects/drscheme/private/honu-logo.ss @@ -1,8 +1,8 @@ -#lang scheme/base +#lang racket/base (provide draw-honu) -(require scheme/class - scheme/gui/base +(require racket/class + racket/gui/base "palaka.ss") (define pi (atan 0 -1)) diff --git a/collects/drscheme/private/init.ss b/collects/drscheme/private/init.ss index 5c69bf7ca6..d3fc01bdc2 100644 --- a/collects/drscheme/private/init.ss +++ b/collects/drscheme/private/init.ss @@ -1,8 +1,7 @@ #lang scheme/unit (require string-constants "drsig.ss" - mzlib/list - mred) + racket/gui/base) (import) diff --git a/collects/drscheme/private/insert-large-letters.ss b/collects/drscheme/private/insert-large-letters.ss index 609d7ffa85..5184e03d5d 100644 --- a/collects/drscheme/private/insert-large-letters.ss +++ b/collects/drscheme/private/insert-large-letters.ss @@ -2,7 +2,7 @@ (require typed/mred/mred typed/framework/framework - scheme/class + racket/class string-constants/string-constant) diff --git a/collects/drscheme/private/key.ss b/collects/drscheme/private/key.ss index ccd52cc2d3..0df77cdffc 100644 --- a/collects/drscheme/private/key.ss +++ b/collects/drscheme/private/key.ss @@ -1,4 +1,4 @@ -#lang mzscheme +#lang racket/base (provide break-threads) (define super-cust (current-custodian)) (define first-child (make-custodian)) diff --git a/collects/drscheme/private/label-frame-mred.ss b/collects/drscheme/private/label-frame-mred.ss index 1ca3158cc0..842153fcb7 100644 --- a/collects/drscheme/private/label-frame-mred.ss +++ b/collects/drscheme/private/label-frame-mred.ss @@ -1,28 +1,28 @@ -#lang mzscheme - (require mred - mzlib/class) - (provide (all-from-except mred frame%) - (rename registering-frame% frame%) +#lang racket/base + (require racket/gui/base + racket/class) + (provide (except-out (all-from-out racket/gui/base) frame%) + (rename-out [registering-frame% frame%]) lookup-frame-name) (define (lookup-frame-name frame) (semaphore-wait label-sema) (begin0 - (hash-table-get label-ht frame (λ () #f)) + (hash-ref label-ht frame (λ () #f)) (semaphore-post label-sema))) (define label-sema (make-semaphore 1)) - (define label-ht (make-hash-table 'weak)) + (define label-ht (make-weak-hasheq)) (define registering-frame% (class frame% (define/override (set-label x) (semaphore-wait label-sema) - (hash-table-put! label-ht this x) + (hash-set! label-ht this x) (semaphore-post label-sema) (super set-label x)) (inherit get-label) (super-instantiate ()) (semaphore-wait label-sema) - (hash-table-put! label-ht this (get-label)) + (hash-set! label-ht this (get-label)) (semaphore-post label-sema))) diff --git a/collects/drscheme/private/language-configuration.ss b/collects/drscheme/private/language-configuration.ss index 1b9e223a7f..20efcb9c11 100644 --- a/collects/drscheme/private/language-configuration.ss +++ b/collects/drscheme/private/language-configuration.ss @@ -1,13 +1,13 @@ -#lang scheme/base +#lang racket/base (require scheme/unit mrlib/hierlist - scheme/class - scheme/contract - scheme/string - scheme/list + racket/class + racket/contract + racket/string + racket/list + racket/gui/base "drsig.ss" string-constants - mred framework setup/getinfo syntax/toplevel @@ -1252,7 +1252,12 @@ (message-box (string-constant drscheme) (format - "The drscheme-language-position, drscheme-language-modules, drscheme-language-numbers, and drscheme-language-readers specifications aren't correct. Expected (listof (cons string (listof string))), (listof (listof string)), (listof (listof number)), (listof string), (listof string), and (listof module-spec) respectively, where the lengths of the outer lists are the same. Got ~e, ~e, ~e, ~e, ~e, and ~e" + (string-append + "The drscheme-language-position, drscheme-language-modules, drscheme-language-numbers," + " and drscheme-language-readers specifications aren't correct. Expected" + " (listof (cons string (listof string))), (listof (listof string)), (listof (listof number)), (listof string)," + " (listof string), and (listof module-spec) respectively, where the lengths of the outer lists are the same." + " Got ~e, ~e, ~e, ~e, ~e, and ~e") lang-positions lang-modules numberss @@ -1431,7 +1436,7 @@ (let ([words #f]) (λ () (unless words - (set! words (text:get-completions/manuals '(scheme/base scheme/contract)))) + (set! words (text:get-completions/manuals '(racket/base racket/contract)))) words))) (define get-all-manual-keywords diff --git a/collects/drscheme/private/language-object-contract.ss b/collects/drscheme/private/language-object-contract.ss index dbb6eba60c..a9836f12d4 100644 --- a/collects/drscheme/private/language-object-contract.ss +++ b/collects/drscheme/private/language-object-contract.ss @@ -1,14 +1,14 @@ #reader scribble/reader -#lang scheme/base -(require (for-syntax scheme/base) +#lang racket/base +(require (for-syntax racket/base) scribble/srcdoc - scheme/class - scheme/gui/base - scheme/contract + racket/class + racket/gui/base + racket/contract "recon.ss") -(require/doc scheme/base scribble/manual) +(require/doc racket/base scribble/manual) -(require (for-meta 2 scheme/base)) +(require (for-meta 2 racket/base)) (provide language-object-abstraction) diff --git a/collects/drscheme/private/language.ss b/collects/drscheme/private/language.ss index 7387ce3377..d9f61db1c4 100644 --- a/collects/drscheme/private/language.ss +++ b/collects/drscheme/private/language.ss @@ -9,17 +9,17 @@ ;; NOTE: this module instantiates stacktrace itself, so we have ;; to be careful to not mix that instantiation with the one - ;; drscheme/private/debug.ss does. errortrace-lib's is for the + ;; drracket/private/debug.ss does. errortrace-lib's is for the ;; compilation handling, DrScheme's is for profiling and test coverage ;; (which do not do compilation) (prefix-in el: errortrace/errortrace-lib) mzlib/pconvert - scheme/pretty + racket/pretty mzlib/struct - scheme/class - scheme/file - scheme/list + racket/class + racket/file + racket/list compiler/embed launcher mred diff --git a/collects/drscheme/private/launcher-bootstrap.ss b/collects/drscheme/private/launcher-bootstrap.ss index 13e63f0313..36074c81e3 100644 --- a/collects/drscheme/private/launcher-bootstrap.ss +++ b/collects/drscheme/private/launcher-bootstrap.ss @@ -1,8 +1,8 @@ -#lang scheme/base +#lang racket/base (provide startup) -(require scheme/file) +(require racket/file) (define (read-from-string s) (read (open-input-string s))) diff --git a/collects/drscheme/private/launcher-mred-bootstrap.ss b/collects/drscheme/private/launcher-mred-bootstrap.ss index 20820223ab..ac676bb763 100644 --- a/collects/drscheme/private/launcher-mred-bootstrap.ss +++ b/collects/drscheme/private/launcher-mred-bootstrap.ss @@ -1,9 +1,9 @@ -#lang scheme/base +#lang racket/base -(require scheme/gui/base "launcher-bootstrap.ss") +(require racket/gui/base "launcher-bootstrap.ss") (current-namespace (make-gui-empty-namespace)) -(namespace-require 'scheme/gui/base) -(namespace-require 'scheme/class) +(namespace-require 'racket/gui/base) +(namespace-require 'racket/class) (startup) diff --git a/collects/drscheme/private/launcher-mz-bootstrap.ss b/collects/drscheme/private/launcher-mz-bootstrap.ss index f591a62c7a..e2054aebca 100644 --- a/collects/drscheme/private/launcher-mz-bootstrap.ss +++ b/collects/drscheme/private/launcher-mz-bootstrap.ss @@ -1,8 +1,8 @@ -#lang scheme/base +#lang racket/base (require "launcher-bootstrap.ss") (current-namespace (make-base-empty-namespace)) -(namespace-require 'scheme/base) +(namespace-require 'racket/base) (startup) diff --git a/collects/drscheme/private/link.ss b/collects/drscheme/private/link.ss index e2fabeceb9..e1ded533aa 100644 --- a/collects/drscheme/private/link.ss +++ b/collects/drscheme/private/link.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scheme/unit "modes.ss" "font.ss" diff --git a/collects/drscheme/private/main.ss b/collects/drscheme/private/main.ss index 998285168a..d54f1fd7dc 100644 --- a/collects/drscheme/private/main.ss +++ b/collects/drscheme/private/main.ss @@ -7,7 +7,7 @@ framework mzlib/class mzlib/list - scheme/path + racket/path browser/external setup/plt-installer) diff --git a/collects/drscheme/private/modes.ss b/collects/drscheme/private/modes.ss index 973d6275d2..f9a717578e 100644 --- a/collects/drscheme/private/modes.ss +++ b/collects/drscheme/private/modes.ss @@ -1,7 +1,7 @@ #lang scheme/unit (require string-constants - mzlib/class - mzlib/list + racket/class + racket/list framework "drsig.ss") @@ -23,7 +23,7 @@ (define (not-a-language-language? l) (and (not (null? l)) - (equal? (car (last-pair l)) + (equal? (last l) (string-constant no-language-chosen)))) (define (add-initial-modes) diff --git a/collects/drscheme/private/module-browser.ss b/collects/drscheme/private/module-browser.ss index d58fd4da64..281cfba0fc 100644 --- a/collects/drscheme/private/module-browser.ss +++ b/collects/drscheme/private/module-browser.ss @@ -1,7 +1,7 @@ -#lang scheme/base +#lang racket/base (require mred - scheme/class + racket/class syntax/moddep syntax/toplevel framework/framework @@ -9,7 +9,7 @@ mrlib/graph "drsig.ss" scheme/unit - scheme/async-channel + racket/async-channel setup/private/lib-roots) (define-struct req (filename key)) diff --git a/collects/drscheme/private/module-language-tools.ss b/collects/drscheme/private/module-language-tools.ss index 73bc52053d..deead1f19e 100644 --- a/collects/drscheme/private/module-language-tools.ss +++ b/collects/drscheme/private/module-language-tools.ss @@ -1,12 +1,12 @@ -#lang scheme/base +#lang racket/base (provide module-language-tools@) (require mrlib/switchable-button mrlib/bitmap-label - scheme/contract + racket/contract framework scheme/unit - scheme/class - scheme/gui/base + racket/class + racket/gui/base "drsig.ss") (define op (current-output-port)) diff --git a/collects/drscheme/private/module-language.ss b/collects/drscheme/private/module-language.ss index 7c09d02989..6ffa79b563 100644 --- a/collects/drscheme/private/module-language.ss +++ b/collects/drscheme/private/module-language.ss @@ -1,11 +1,11 @@ -#lang scheme/base +#lang racket/base (provide module-language@) (require scheme/unit - scheme/class - scheme/list - scheme/path - scheme/contract + racket/class + racket/list + racket/path + racket/contract mred compiler/embed compiler/cm @@ -382,7 +382,7 @@ #:literal-expression (begin (parameterize ([current-namespace (make-base-empty-namespace)]) - (namespace-require 'scheme/base) + (namespace-require 'racket/base) (compile `(namespace-require '',(string->symbol (path->string short-program-name)))))) #:cmdline '("-U" "--"))))) @@ -672,7 +672,7 @@ (raise-hopeless-syntax-error "bad syntax in name position of module" stx name)) (when filename (check-filename-matches filename name* stx)) - (let* (;; rewrite the module to use the scheme/base version of `module' + (let* (;; rewrite the module to use the racket/base version of `module' [mod (datum->syntax #'here 'module mod)] [expr (datum->syntax stx `(,mod ,name ,lang . ,body) stx stx)]) (values name lang expr))) diff --git a/collects/drscheme/private/multi-file-search.ss b/collects/drscheme/private/multi-file-search.ss index f185e45972..aa1647cd05 100644 --- a/collects/drscheme/private/multi-file-search.ss +++ b/collects/drscheme/private/multi-file-search.ss @@ -2,8 +2,8 @@ (require framework mzlib/class mred - scheme/file - scheme/path + racket/file + racket/path mzlib/thread mzlib/async-channel string-constants diff --git a/collects/drscheme/private/number-snip.ss b/collects/drscheme/private/number-snip.ss index 5426620d15..c224e5ab3a 100644 --- a/collects/drscheme/private/number-snip.ss +++ b/collects/drscheme/private/number-snip.ss @@ -1,6 +1,6 @@ -#lang mzscheme +#lang racket/base (require mred - mzlib/class + racket/class framework) (provide snip-class) diff --git a/collects/drscheme/private/palaka.ss b/collects/drscheme/private/palaka.ss index 70ba631293..f10c0e9f9f 100755 --- a/collects/drscheme/private/palaka.ss +++ b/collects/drscheme/private/palaka.ss @@ -1,5 +1,5 @@ -#lang scheme/base -(require scheme/class scheme/gui/base) +#lang racket/base +(require racket/class racket/gui/base) (provide draw-palaka palaka-pattern-size) (define scale 1) diff --git a/collects/drscheme/private/prefs-contract.ss b/collects/drscheme/private/prefs-contract.ss index dd62fb14d3..d850ca725e 100644 --- a/collects/drscheme/private/prefs-contract.ss +++ b/collects/drscheme/private/prefs-contract.ss @@ -1,6 +1,6 @@ -#lang scheme/base +#lang racket/base -(require (for-syntax scheme/base) +(require (for-syntax racket/base) framework/framework) (provide (rename-out [-preferences:get preferences:get]) diff --git a/collects/drscheme/private/profile-drs.ss b/collects/drscheme/private/profile-drs.ss index 78e0131d1f..819e83ae71 100644 --- a/collects/drscheme/private/profile-drs.ss +++ b/collects/drscheme/private/profile-drs.ss @@ -1,6 +1,6 @@ -#lang scheme/base -(require scheme/gui/base - scheme/class +#lang racket/base +(require racket/gui/base + racket/class profile/sampler profile/render-text profile/analyzer diff --git a/collects/drscheme/private/recon.ss b/collects/drscheme/private/recon.ss index 6c9a7f1822..3d7c37ce91 100644 --- a/collects/drscheme/private/recon.ss +++ b/collects/drscheme/private/recon.ss @@ -1,5 +1,5 @@ -#lang scheme/base -(require (for-syntax scheme/base)) +#lang racket/base +(require (for-syntax racket/base)) (provide reconstitute) (begin-for-syntax diff --git a/collects/drscheme/private/rep.ss b/collects/drscheme/private/rep.ss index 35aa44c1f5..7a8d95f40b 100644 --- a/collects/drscheme/private/rep.ss +++ b/collects/drscheme/private/rep.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base #| @@ -20,15 +20,15 @@ TODO ;; user's io ports, to aid any debugging printouts. ;; (esp. useful when debugging the users's io) -(require scheme/class - scheme/path - scheme/pretty +(require racket/class + racket/path + racket/pretty scheme/unit - scheme/list + racket/list string-constants setup/xref - scheme/gui/base + racket/gui/base framework browser/external "drsig.ss" diff --git a/collects/drscheme/private/stick-figures.ss b/collects/drscheme/private/stick-figures.ss index 49a404ed67..dbe81bc423 100644 --- a/collects/drscheme/private/stick-figures.ss +++ b/collects/drscheme/private/stick-figures.ss @@ -1,7 +1,7 @@ -#lang mzscheme - (require mzlib/class - mzlib/pretty - mred) +#lang racket/base + (require racket/class + racket/pretty + racket/gui/base) (define head-size 40) (define small-bitmap-factor 1/2) diff --git a/collects/drscheme/private/tools.ss b/collects/drscheme/private/tools.ss index 5198030441..d66d10a192 100644 --- a/collects/drscheme/private/tools.ss +++ b/collects/drscheme/private/tools.ss @@ -1,9 +1,9 @@ #lang scheme/unit -(require scheme/class - scheme/list - scheme/runtime-path - scheme/contract +(require racket/class + racket/list + racket/runtime-path + racket/contract setup/getinfo mred framework @@ -13,7 +13,7 @@ mrlib/switchable-button string-constants) -(require (for-syntax scheme/base scheme/match)) +(require (for-syntax racket/base racket/match)) (import [prefix drscheme:frame: drscheme:frame^] [prefix drscheme:unit: drscheme:unit^] diff --git a/collects/drscheme/private/tracing.ss b/collects/drscheme/private/tracing.ss index 599b359d11..f30b0568cb 100644 --- a/collects/drscheme/private/tracing.ss +++ b/collects/drscheme/private/tracing.ss @@ -1,12 +1,12 @@ -#lang scheme/base +#lang racket/base -(require scheme/contract +(require racket/contract scheme/unit - scheme/class - scheme/path - scheme/port - scheme/list - scheme/gui/base + racket/class + racket/path + racket/port + racket/list + racket/gui/base string-constants framework (prefix-in tr: trace/stacktrace) diff --git a/collects/drscheme/private/ts.ss b/collects/drscheme/private/ts.ss index e1d6de5dc8..eb706554ef 100644 --- a/collects/drscheme/private/ts.ss +++ b/collects/drscheme/private/ts.ss @@ -1,5 +1,4 @@ -#reader scribble/reader -#lang scheme/base +#lang at-exp racket/base (require scribble/decode scribble/manual) diff --git a/collects/drscheme/private/unit.ss b/collects/drscheme/private/unit.ss index 67c1f52236..47b5df12c0 100644 --- a/collects/drscheme/private/unit.ss +++ b/collects/drscheme/private/unit.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base #| closing: @@ -11,12 +11,12 @@ module browser threading seems wrong. |# - (require scheme/contract + (require racket/contract scheme/unit - scheme/class - scheme/path - scheme/port - scheme/list + racket/class + racket/path + racket/port + racket/list string-constants framework mrlib/name-message diff --git a/collects/drscheme/sprof.ss b/collects/drscheme/sprof.ss index 099dc03230..5f66b0c1ea 100644 --- a/collects/drscheme/sprof.ss +++ b/collects/drscheme/sprof.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scheme/gui/base framework scheme/class) diff --git a/collects/drscheme/syncheck-drscheme-button.ss b/collects/drscheme/syncheck-drscheme-button.ss index 25e5279643..a4d7f28d30 100644 --- a/collects/drscheme/syncheck-drscheme-button.ss +++ b/collects/drscheme/syncheck-drscheme-button.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base (require scheme/class scheme/gui/base string-constants/string-constant) diff --git a/collects/drscheme/syncheck.ss b/collects/drscheme/syncheck.ss index 09c7ad29db..128cfa3496 100644 --- a/collects/drscheme/syncheck.ss +++ b/collects/drscheme/syncheck.ss @@ -1,4 +1,4 @@ -#lang scheme/base +#lang racket/base #| Check Syntax separates two classes of identifiers, diff --git a/collects/drscheme/tool-lib.ss b/collects/drscheme/tool-lib.ss index cbfa92f77b..440b8387fe 100644 --- a/collects/drscheme/tool-lib.ss +++ b/collects/drscheme/tool-lib.ss @@ -1,4 +1,4 @@ -#lang at-exp scheme/base +#lang at-exp racket/base #| diff --git a/collects/drscheme/tool.ss b/collects/drscheme/tool.ss index 7fd1b8188c..ff4a7fbf66 100644 --- a/collects/drscheme/tool.ss +++ b/collects/drscheme/tool.ss @@ -1,4 +1,5 @@ -(module tool mzscheme - (require "private/drsig.ss") - (provide drscheme:tool^ - drscheme:tool-exports^)) +#lang racket/base +(require "private/drsig.ss") +(provide drscheme:tool^ + drscheme:tool-exports^) +