improve scribble index support

svn: r7047
This commit is contained in:
Matthew Flatt 2007-08-07 20:39:54 +00:00
parent c6b723bbd8
commit ab9c34a8ec
43 changed files with 736 additions and 523 deletions

View File

@ -69,8 +69,8 @@
(let ([p-ht (make-hash-table 'equal)]) (let ([p-ht (make-hash-table 'equal)])
(when (part-title-content d) (when (part-title-content d)
(collect-content (part-title-content d) p-ht)) (collect-content (part-title-content d) p-ht))
(when (part-tag d) (collect-part-tags d p-ht number)
(collect-part-tag d p-ht number)) (collect-content (part-to-collect d) p-ht)
(collect-flow (part-flow d) p-ht) (collect-flow (part-flow d) p-ht)
(let loop ([parts (part-parts d)] (let loop ([parts (part-parts d)]
[pos 1]) [pos 1])
@ -91,8 +91,10 @@
(lambda (k v) (lambda (k v)
(hash-table-put! ht k v))))) (hash-table-put! ht k v)))))
(define/public (collect-part-tag d ht number) (define/public (collect-part-tags d ht number)
(hash-table-put! ht `(part ,(part-tag d)) (list (part-title-content d) number))) (for-each (lambda (t)
(hash-table-put! ht `(part ,t) (list (part-title-content d) number)))
(part-tags d)))
(define/public (collect-content c ht) (define/public (collect-content c ht)
(for-each (lambda (i) (for-each (lambda (i)
@ -316,7 +318,7 @@
(list (list
(make-element 'hspace '(" ")))) (make-element 'hspace '(" "))))
(part-title-content part)) (part-title-content part))
`(part ,(part-tag part)))))))) `(part ,(car (part-tags part)))))))))
subs)]) subs)])
(if (and (= 1 (length number)) (if (and (= 1 (length number))
(or (not (car number)) (or (not (car number))

View File

@ -119,10 +119,13 @@
;; ---------------------------------------- ;; ----------------------------------------
(provide index index* as-index index-section) (provide section-index index index* as-index index-section)
(define (section-index . elems)
(make-section-index-decl (map element->string elems) elems))
(define (gen-target) (define (gen-target)
(format "index:~s:~s" (current-seconds) (gensym))) (format "index:~s:~s" (current-inexact-milliseconds) (gensym)))
(define (record-index word-seq element-seq tag content) (define (record-index word-seq element-seq tag content)
(make-index-element (make-index-element
@ -155,9 +158,10 @@
(define (index-section tag) (define (index-section tag)
(make-unnumbered-part (make-unnumbered-part
tag (and tag (list tag))
(list "Index") (list "Index")
#f #f
null
(make-flow (list (make-delayed-flow-element (make-flow (list (make-delayed-flow-element
(lambda (renderer sec ht) (lambda (renderer sec ht)
(let ([l null]) (let ([l null])
@ -180,7 +184,14 @@
[(string-ci=? (car a) (car b)) [(string-ci=? (car a) (car b))
(loop (cdr a) (cdr b))] (loop (cdr a) (cdr b))]
[else [else
(string-ci<? (car a) (car b))]))))]) (string-ci<? (car a) (car b))]))))]
[commas (lambda (l)
(if (or (null? l)
(null? (cdr l)))
l
(cdr (apply append (map (lambda (i)
(list ", " i))
l)))))])
(make-table (make-table
'index 'index
(map (lambda (i) (map (lambda (i)
@ -189,11 +200,12 @@
(make-paragraph (make-paragraph
(list (list
(make-link-element (make-link-element
#f "indexlink"
(caddr i) (commas (caddr i))
(car i)))))))) (car i))))))))
l)))))))) l))))))))
null)) null
'index))
;; ---------------------------------------- ;; ----------------------------------------

View File

@ -19,7 +19,9 @@
[part-start ([depth integer?] [part-start ([depth integer?]
[tag (or/c false/c string?)] [tag (or/c false/c string?)]
[title list?])] [title list?])]
[splice ([run list?])]) [splice ([run list?])]
[section-index-decl ([plain-seq (listof string?)]
[entry-seq list?])])
(define (decode-string s) (define (decode-string s)
(let loop ([l '((#rx"---" mdash) (let loop ([l '((#rx"---" mdash)
@ -49,15 +51,39 @@
null null
(list (decode-paragraph (reverse (skip-whitespace accum)))))) (list (decode-paragraph (reverse (skip-whitespace accum))))))
(define (decode-flow* l tag style title part-depth) (define (decode-flow* l keys tag style title part-depth)
(let loop ([l l][next? #f][accum null][title title][tag tag][style style]) (let loop ([l l][next? #f][keys keys][accum null][title title][tag tag][style style])
(cond (cond
[(null? l) (make-styled-part tag [(null? l)
(let ([tags (map (lambda (k)
(format "secindex:~a:~a" (current-inexact-milliseconds) (gensym)))
keys)]
[tag (or tag (format "sec:~a:~a" (current-inexact-milliseconds) (gensym)))])
(make-styled-part (cons tag
tags)
title title
#f #f
(let ([l (map (lambda (k tag)
(make-index-element
#f
null
`(part ,tag)
(section-index-decl-plain-seq k)
(section-index-decl-entry-seq k)))
keys tags)])
(if title
(cons (make-index-element
#f
null
`(part ,tag)
(list (regexp-replace #px"^(?:A|An|The)\\s" (content->string title)
""))
(list (make-element #f title)))
l)
l))
(make-flow (decode-accum-para accum)) (make-flow (decode-accum-para accum))
null null
style)] style))]
[(title-decl? (car l)) [(title-decl? (car l))
(unless part-depth (unless part-depth
(error 'decode (error 'decode
@ -67,16 +93,17 @@
(error 'decode (error 'decode
"found extra title: ~v" "found extra title: ~v"
(car l))) (car l)))
(loop (cdr l) next? accum (loop (cdr l) next? keys accum
(title-decl-content (car l)) (title-decl-content (car l))
(title-decl-tag (car l)) (title-decl-tag (car l))
(title-decl-style (car l)))] (title-decl-style (car l)))]
[(flow-element? (car l)) [(flow-element? (car l))
(let ([para (decode-accum-para accum)] (let ([para (decode-accum-para accum)]
[part (decode-flow* (cdr l) tag style title part-depth)]) [part (decode-flow* (cdr l) keys tag style title part-depth)])
(make-styled-part (part-tag part) (make-styled-part (part-tags part)
(part-title-content part) (part-title-content part)
(part-collected-info part) (part-collected-info part)
(part-to-collect part)
(make-flow (append para (make-flow (append para
(list (car l)) (list (car l))
(flow-paragraphs (part-flow part)))) (flow-paragraphs (part-flow part))))
@ -84,10 +111,11 @@
(styled-part-style part)))] (styled-part-style part)))]
[(part? (car l)) [(part? (car l))
(let ([para (decode-accum-para accum)] (let ([para (decode-accum-para accum)]
[part (decode-flow* (cdr l) tag style title part-depth)]) [part (decode-flow* (cdr l) keys tag style title part-depth)])
(make-styled-part (part-tag part) (make-styled-part (part-tags part)
(part-title-content part) (part-title-content part)
(part-collected-info part) (part-collected-info part)
(part-to-collect part)
(make-flow (append para (make-flow (append para
(flow-paragraphs (flow-paragraphs
(part-flow part)))) (part-flow part))))
@ -112,41 +140,45 @@
(part-start-tag s) (part-start-tag s)
(part-start-title s) (part-start-title s)
(add1 part-depth))] (add1 part-depth))]
[part (decode-flow* l tag style title part-depth)]) [part (decode-flow* l keys tag style title part-depth)])
(make-styled-part (part-tag part) (make-styled-part (part-tags part)
(part-title-content part) (part-title-content part)
(part-collected-info part) (part-collected-info part)
(part-to-collect part)
(make-flow para) (make-flow para)
(cons s (part-parts part)) (cons s (part-parts part))
(styled-part-style part))) (styled-part-style part)))
(loop (cdr l) (cons (car l) s-accum)))))] (loop (cdr l) (cons (car l) s-accum)))))]
[(splice? (car l)) [(splice? (car l))
(loop (append (splice-run (car l)) (cdr l)) next? accum title tag style)] (loop (append (splice-run (car l)) (cdr l)) next? keys accum title tag style)]
[(null? (cdr l)) (loop null #f (cons (car l) accum) title tag style)] [(null? (cdr l)) (loop null #f keys (cons (car l) accum) title tag style)]
[(section-index-decl? (car l))
(loop (cdr l) next? (cons (car l) keys) accum title tag style)]
[(and (pair? (cdr l)) [(and (pair? (cdr l))
(splice? (cadr l))) (splice? (cadr l)))
(loop (cons (car l) (append (splice-run (cadr l)) (cddr l))) next? accum title tag style)] (loop (cons (car l) (append (splice-run (cadr l)) (cddr l))) next? keys accum title tag style)]
[(line-break? (car l)) [(line-break? (car l))
(if next? (if next?
(loop (cdr l) #t accum title tag style) (loop (cdr l) #t keys accum title tag style)
(let ([m (match-newline-whitespace (cdr l))]) (let ([m (match-newline-whitespace (cdr l))])
(if m (if m
(let ([part (loop m #t null title tag style)]) (let ([part (loop m #t keys null title tag style)])
(make-styled-part (part-tag part) (make-styled-part (part-tags part)
(part-title-content part) (part-title-content part)
(part-collected-info part) (part-collected-info part)
(part-to-collect part)
(make-flow (append (decode-accum-para accum) (make-flow (append (decode-accum-para accum)
(flow-paragraphs (part-flow part)))) (flow-paragraphs (part-flow part))))
(part-parts part) (part-parts part)
(styled-part-style part))) (styled-part-style part)))
(loop (cdr l) #f (cons (car l) accum) title tag style))))] (loop (cdr l) #f keys (cons (car l) accum) title tag style))))]
[else (loop (cdr l) #f (cons (car l) accum) title tag style)]))) [else (loop (cdr l) #f keys (cons (car l) accum) title tag style)])))
(define (decode-part l tag title depth) (define (decode-part l tag title depth)
(decode-flow* l tag #f title depth)) (decode-flow* l null tag #f title depth))
(define (decode-flow l) (define (decode-flow l)
(part-flow (decode-flow* l #f #f #f #f))) (part-flow (decode-flow* l null #f #f #f #f)))
(define (match-newline-whitespace l) (define (match-newline-whitespace l)
(cond (cond

View File

@ -19,6 +19,7 @@
(define next-separate-page (make-parameter #f)) (define next-separate-page (make-parameter #f))
(define collecting-sub (make-parameter 0)) (define collecting-sub (make-parameter 0))
(define current-no-links (make-parameter #f)) (define current-no-links (make-parameter #f))
(define extra-breaking? (make-parameter #f))
;; ---------------------------------------- ;; ----------------------------------------
;; main mixin ;; main mixin
@ -49,18 +50,20 @@
ht)) ht))
(define/public (part-whole-page? p ht) (define/public (part-whole-page? p ht)
(let ([dest (lookup p ht `(part ,(part-tag p)))]) (let ([dest (lookup p ht `(part ,(car (part-tags p))))])
(caddr dest))) (caddr dest)))
(define/public (current-part-whole-page?) (define/public (current-part-whole-page?)
#f) #f)
(define/override (collect-part-tag d ht number) (define/override (collect-part-tags d ht number)
(for-each (lambda (t)
(hash-table-put! ht (hash-table-put! ht
`(part ,(part-tag d)) `(part ,t)
(list (current-output-file) (list (current-output-file)
(part-title-content d) (part-title-content d)
(current-part-whole-page?)))) (current-part-whole-page?))))
(part-tags d)))
(define/override (collect-target-element i ht) (define/override (collect-target-element i ht)
(hash-table-put! ht (hash-table-put! ht
@ -93,7 +96,7 @@
,@(format-number (collected-info-number (part-collected-info p)) ,@(format-number (collected-info-number (part-collected-info p))
'((tt nbsp)))) '((tt nbsp))))
(td (td
(a ((href ,(let ([dest (lookup p ht `(part ,(part-tag p)))]) (a ((href ,(let ([dest (lookup p ht `(part ,(car (part-tags p))))])
(format "~a~a~a" (format "~a~a~a"
(from-root (car dest) (from-root (car dest)
(get-dest-directory)) (get-dest-directory))
@ -102,7 +105,7 @@
"#") "#")
(if (caddr dest) (if (caddr dest)
"" ""
`(part ,(part-tag p)))))) `(part ,(car (part-tags p)))))))
(class ,(if (eq? p mine) (class ,(if (eq? p mine)
"tocviewselflink" "tocviewselflink"
"tocviewlink"))) "tocviewlink")))
@ -167,7 +170,8 @@
((class "tocsublist") ((class "tocsublist")
(cellspacing "0")) (cellspacing "0"))
,@(map (lambda (p) ,@(map (lambda (p)
(parameterize ([current-no-links #t]) (parameterize ([current-no-links #t]
[extra-breaking? #t])
`(tr `(tr
(td (td
,@(if (part? p) ,@(if (part? p)
@ -176,9 +180,9 @@
'((tt nbsp))))) '((tt nbsp)))))
'("")) '(""))
(a ((href ,(if (part? p) (a ((href ,(if (part? p)
(let ([dest (lookup p ht `(part ,(part-tag p)))]) (let ([dest (lookup p ht `(part ,(car (part-tags p))))])
(format "#~a" (format "#~a"
`(part ,(part-tag p)))) `(part ,(car (part-tags p)))))
(format "#~a" (target-element-tag p)))) (format "#~a" (target-element-tag p))))
(class ,(if (part? p) (class ,(if (part? p)
"tocsubseclink" "tocsubseclink"
@ -221,9 +225,9 @@
[(2) 'h4] [(2) 'h4]
[else 'h5]) [else 'h5])
,@(format-number number '((tt nbsp))) ,@(format-number number '((tt nbsp)))
,@(if (part-tag d) ,@(map (lambda (t)
`((a ((name ,(format "~a" `(part ,(part-tag d))))))) `(a ((name ,(format "~a" `(part ,t))))))
null) (part-tags d))
,@(if (part-title-content d) ,@(if (part-title-content d)
(render-content (part-title-content d) d ht) (render-content (part-title-content d) d ht)
null)))) null))))
@ -399,7 +403,13 @@
(define/override (render-other i part ht) (define/override (render-other i part ht)
(cond (cond
[(string? i) (list i)] [(string? i) (let ([m (and (extra-breaking?)
(regexp-match-positions #rx":" i))])
(if m
(list* (substring i 0 (cdar m))
`(span ((class "mywbr")) " ")
(render-other (substring i (cdar m)) part ht))
(list i)))]
[(eq? i 'mdash) `(" " ndash " ")] [(eq? i 'mdash) `(" " ndash " ")]
[(eq? i 'hline) `((hr))] [(eq? i 'hline) `((hr))]
[(symbol? i) (list i)] [(symbol? i) (list i)]
@ -428,9 +438,7 @@
(define/private (derive-filename d ht) (define/private (derive-filename d ht)
(let ([fn (format "~a.html" (regexp-replace* (let ([fn (format "~a.html" (regexp-replace*
"[^-a-zA-Z0-9_=]" "[^-a-zA-Z0-9_=]"
(or (format "~a" (part-tag d)) (format "~a" (car (part-tags d)))
(content->string (part-title-content d)
this d ht))
"_"))]) "_"))])
(when ((string-length fn) . >= . 48) (when ((string-length fn) . >= . 48)
(error "file name too long (need a tag):" fn)) (error "file name too long (need a tag):" fn))
@ -560,7 +568,7 @@
(make-link-element (make-link-element
#f #f
index-content index-content
`(part ,(part-tag index))))))))) `(part ,(car (part-tags index))))))))))
null)))) null))))
d ht) d ht)
,@(render-table (make-table ,@(render-table (make-table

View File

@ -6,6 +6,7 @@
(define current-table-mode (make-parameter #f)) (define current-table-mode (make-parameter #f))
(define rendering-tt (make-parameter #f)) (define rendering-tt (make-parameter #f))
(define show-link-page-numbers (make-parameter #f))
(define-struct (toc-paragraph paragraph) ()) (define-struct (toc-paragraph paragraph) ())
@ -69,8 +70,9 @@
(printf "\\newcommand{\\schemeinput}[1]{\\colorbox{LightGray}{\\hspace{-0.5ex}\\schemeinputbg{#1}\\hspace{-0.5ex}}}\n") (printf "\\newcommand{\\schemeinput}[1]{\\colorbox{LightGray}{\\hspace{-0.5ex}\\schemeinputbg{#1}\\hspace{-0.5ex}}}\n")
(printf "\\newcommand{\\highlighted}[1]{\\colorbox{PaleBlue}{\\hspace{-0.5ex}\\schemeinputbg{#1}\\hspace{-0.5ex}}}\n") (printf "\\newcommand{\\highlighted}[1]{\\colorbox{PaleBlue}{\\hspace{-0.5ex}\\schemeinputbg{#1}\\hspace{-0.5ex}}}\n")
(printf "\\newcommand{\\techlink}[1]{#1}\n") (printf "\\newcommand{\\techlink}[1]{#1}\n")
(printf "\\newcommand{\\indexlink}[1]{#1}\n")
(printf "\\newcommand{\\imageleft}[1]{} % drop it\n") (printf "\\newcommand{\\imageleft}[1]{} % drop it\n")
(printf "\\begin{document}\n") (printf "\\begin{document}\n\\sloppy\n")
(when (part-title-content d) (when (part-title-content d)
(printf "\\title{") (printf "\\title{")
(render-content (part-title-content d) d ht) (render-content (part-title-content d) d ht)
@ -82,6 +84,9 @@
(let ([number (collected-info-number (part-collected-info d))]) (let ([number (collected-info-number (part-collected-info d))])
(when (and (part-title-content d) (when (and (part-title-content d)
(pair? number)) (pair? number))
(when (and (styled-part? d)
(eq? 'index (styled-part-style d)))
(printf "\\twocolumn\n\\parskip=0pt\n\\addcontentsline{toc}{section}{Index}\n"))
(printf "\\~a~a{" (printf "\\~a~a{"
(case (length number) (case (length number)
[(0 1) "newpage\n\n\\section"] [(0 1) "newpage\n\n\\section"]
@ -93,10 +98,13 @@
"*" "*"
"")) ""))
(render-content (part-title-content d) d ht) (render-content (part-title-content d) d ht)
(printf "}")) (printf "}")
#; (when (and (styled-part? d)
(when (part-tag d) (eq? 'index (styled-part-style d)))
(printf "\\label{section:~a}" (protect-tag (part-tag d)))) (printf "\n\n")))
(for-each (lambda (t)
(printf "\\label{t:~a}" (t-encode `(part ,t))))
(part-tags d))
(render-flow (part-flow d) d ht) (render-flow (part-flow d) d ht)
(for-each (lambda (sec) (render-part sec ht)) (for-each (lambda (sec) (render-part sec ht))
(part-parts d)) (part-parts d))
@ -121,6 +129,9 @@
(pair? (link-element-tag e)) (pair? (link-element-tag e))
(eq? 'part (car (link-element-tag e))) (eq? 'part (car (link-element-tag e)))
(null? (element-content e)))]) (null? (element-content e)))])
(parameterize ([show-link-page-numbers #f])
(when (target-element? e)
(printf "\\label{t:~a}" (t-encode (target-element-tag e))))
(when part-label? (when part-label?
(printf "\\S") (printf "\\S")
(render-content (let ([dest (lookup part ht (link-element-tag e))]) (render-content (let ([dest (lookup part ht (link-element-tag e))])
@ -159,10 +170,27 @@
[(image-file? style) [(image-file? style)
(let ([fn (install-file (image-file-path style))]) (let ([fn (install-file (image-file-path style))])
(printf "\\includegraphics{~a}" fn))] (printf "\\includegraphics{~a}" fn))]
[else (super render-element e part ht)])) [else (super render-element e part ht)])))
(when part-label? (when part-label?
(printf "''"))) (printf "''"))
null) (when (and (link-element? e)
(show-link-page-numbers))
(printf ", \\pageref{t:~a}" (t-encode (link-element-tag e))))
null))
(define/private (t-encode s)
(apply
string-append
(map (lambda (c)
(cond
[(and (or (char-alphabetic? c)
(char-numeric? c))
((char->integer c) . < . 128))
(string c)]
[(char=? c #\space) "_"]
[else
(format "x~x" (char->integer c))]))
(string->list (format "~s" s)))))
(define/override (render-table t part ht) (define/override (render-table t part ht)
(let* ([boxed? (eq? 'boxed (table-style t))] (let* ([boxed? (eq? 'boxed (table-style t))]
@ -176,7 +204,7 @@
(equal? "longtable" (car m)) (equal? "longtable" (car m))
(= 1 (length (car (table-flowss (cadr m))))))))] (= 1 (length (car (table-flowss (cadr m))))))))]
[tableform (cond [tableform (cond
[index? "theindex"] [index? "list"]
[(not (current-table-mode)) [(not (current-table-mode))
"longtable"] "longtable"]
[else "tabular"])] [else "tabular"])]
@ -188,10 +216,11 @@
(null? (car (table-flowss t)))) (null? (car (table-flowss t))))
(parameterize ([current-table-mode (if inline? (parameterize ([current-table-mode (if inline?
(current-table-mode) (current-table-mode)
(list tableform t))]) (list tableform t))]
[show-link-page-numbers (or index?
(show-link-page-numbers))])
(cond (cond
[index? [index? (printf "\\begin{list}{}{\\parsep=0pt \\itemsep=1pt \\leftmargin=2ex \\itemindent=-2ex}\n")]
(printf "\n\n\\begin{theindex}\n")]
[inline? (void)] [inline? (void)]
[else [else
(printf "\n\n~a\\begin{~a}~a{@{}~a}\n" (printf "\n\n~a\\begin{~a}~a{@{}~a}\n"
@ -223,6 +252,8 @@
[row-style (car row-styles)]) [row-style (car row-styles)])
(let loop ([flows flows]) (let loop ([flows flows])
(unless (null? flows) (unless (null? flows)
(when index?
(printf "\\item "))
(unless (eq? 'cont (car flows)) (unless (eq? 'cont (car flows))
(let ([cnt (let loop ([flows (cdr flows)][n 1]) (let ([cnt (let loop ([flows (cdr flows)][n 1])
(cond (cond

View File

@ -88,11 +88,23 @@
(make-element 'tt (list (substring s spaces)))))))))) (make-element 'tt (list (substring s spaces))))))))))
strs)))) strs))))
(define-syntax indexed-scheme
(syntax-rules ()
[(_ x) (add-scheme-index 'x (scheme x))]))
(define (add-scheme-index s e)
(let ([k (if (and (pair? s)
(eq? (car s) 'quote))
(cadr s)
s)])
(index* (list (format "~s" k)) (list e) e)))
(provide schemeblock SCHEMEBLOCK (provide schemeblock SCHEMEBLOCK
schemeblock0 SCHEMEBLOCK0 schemeblock0 SCHEMEBLOCK0
schemeinput schemeinput
schememod schememod
scheme schemeresult schemeid schememodname scheme schemeresult schemeid schememodname
indexed-scheme
litchar litchar
verbatim) verbatim)
@ -100,6 +112,7 @@
schemefont schemevalfont schemeresultfont schemeidfont schemefont schemevalfont schemeresultfont schemeidfont
schemeparenfont schemekeywordfont schememetafont schememodfont schemeparenfont schemekeywordfont schememetafont schememodfont
file exec envvar Flag DFlag file exec envvar Flag DFlag
indexed-file indexed-envvar
link procedure link procedure
idefterm) idefterm)
@ -130,6 +143,10 @@
(make-element "schemekeyword" (decode-content str))) (make-element "schemekeyword" (decode-content str)))
(define (file . str) (define (file . str)
(make-element 'tt (append (list "\"") (decode-content str) (list "\"")))) (make-element 'tt (append (list "\"") (decode-content str) (list "\""))))
(define (indexed-file . str)
(let* ([f (apply file str)]
[s (element->string f)])
(index* (list (substring s 1 (sub1 (string-length s)))) (list f) f)))
(define (exec . str) (define (exec . str)
(make-element 'tt (decode-content str))) (make-element 'tt (decode-content str)))
(define (Flag . str) (define (Flag . str)
@ -138,6 +155,10 @@
(make-element 'tt (cons "--" (decode-content str)))) (make-element 'tt (cons "--" (decode-content str))))
(define (envvar . str) (define (envvar . str)
(make-element 'tt (decode-content str))) (make-element 'tt (decode-content str)))
(define (indexed-envvar . str)
(let* ([f (apply envvar str)]
[s (element->string f)])
(index* (list s) (list f) f)))
(define (procedure . str) (define (procedure . str)
(make-element "schemeresult" (append (list "#<procedure:") (decode-content str) (list ">")))) (make-element "schemeresult" (append (list "#<procedure:") (decode-content str) (list ">"))))
@ -183,7 +204,13 @@
(format "tech-term:~a" s)))) (format "tech-term:~a" s))))
(define (deftech . s) (define (deftech . s)
(*tech make-target-element #f (list (apply defterm s)))) (let* ([e (apply defterm s)]
[t (*tech make-target-element #f (list e))])
(make-index-element #f
(list t)
(target-element-tag t)
(list (element->string e))
(list e))))
(define (tech . s) (define (tech . s)
(*tech make-link-element "techlink" s)) (*tech make-link-element "techlink" s))
@ -487,11 +514,17 @@
(loop (cdr a) (cons (car a) o-accum))))) (loop (cdr a) (cons (car a) o-accum)))))
(loop (cdr a) (cons (car a) r-accum))))] (loop (cdr a) (cons (car a) r-accum))))]
[(tagged) (if first? [(tagged) (if first?
(let ([tag (register-scheme-definition stx-id)]
[content (list (to-element (make-just-context (car prototype)
stx-id)))])
(make-toc-target-element (make-toc-target-element
#f #f
(list (to-element (make-just-context (car prototype) (list (make-index-element #f
stx-id))) content
(register-scheme-definition stx-id)) tag
(list (symbol->string (car prototype)))
content))
tag))
(to-element (make-just-context (car prototype) (to-element (make-just-context (car prototype)
stx-id)))] stx-id)))]
[(flat-size) (prototype-size prototype + +)] [(flat-size) (prototype-size prototype + +)]
@ -667,14 +700,23 @@
(make-target-element* (make-target-element*
make-target-element make-target-element
stx-id stx-id
(inner-make-target-element (let* ([name
#f (apply string-append
(list content) (map symbol->string (car wrappers)))]
[tag
(register-scheme-definition (register-scheme-definition
(datum->syntax-object stx-id (datum->syntax-object stx-id
(string->symbol (string->symbol
(apply string-append name)))])
(map symbol->string (car wrappers))))))) (inner-make-target-element
#f
(list
(make-index-element #f
(list content)
tag
(list name)
(list (schemeidfont (make-element "schemevaluelink" (list name))))))
tag))
(cdr wrappers)))) (cdr wrappers))))
(define (*defstruct stx-id name fields field-contracts immutable? transparent? content-thunk) (define (*defstruct stx-id name fields field-contracts immutable? transparent? content-thunk)
@ -841,10 +883,16 @@
(list (make-flow (list (make-flow
(list (list
(make-paragraph (make-paragraph
(list (make-toc-target-element (list (let ([tag (register-scheme-definition stx-id)]
[content (list (to-element (make-just-context name stx-id)))])
(make-toc-target-element
#f #f
(list (to-element (make-just-context name stx-id))) (list (make-index-element #f
(register-scheme-definition stx-id)) content
tag
(list (symbol->string name))
content))
tag))
spacer ":" spacer spacer ":" spacer
(to-element result-contract)))))))) (to-element result-contract))))))))
(content-thunk)))) (content-thunk))))
@ -890,13 +938,21 @@
. ,(cdr form))))))) . ,(cdr form)))))))
(and kw-id (and kw-id
(eq? form (car forms)) (eq? form (car forms))
(make-toc-target-element (let ([tag (register-scheme-form-definition kw-id)]
#f [content (list (to-element (make-just-context (if (pair? form)
(list (to-element (make-just-context (if (pair? form)
(car form) (car form)
form) form)
kw-id))) kw-id)))])
(register-scheme-form-definition kw-id)))))))) (make-toc-target-element
#f
(if kw-id
(list (make-index-element #f
content
tag
(list (symbol->string (syntax-e kw-id)))
content))
content)
tag))))))))
forms form-procs) forms form-procs)
(if (null? sub-procs) (if (null? sub-procs)
null null

View File

@ -388,6 +388,7 @@
[vd [vd
(make-link-element "schemevaluelink" (list s) vtag)] (make-link-element "schemevaluelink" (list s) vtag)]
[else s])))) [else s]))))
(lambda () s)
(lambda () s)) (lambda () s))
(literalize-spaces s)) (literalize-spaces s))
(cond (cond

View File

@ -118,6 +118,10 @@
font-weight: bold; font-weight: bold;
} }
.indexlink {
text-decoration: none;
}
.title { .title {
font-size: 200%; font-size: 200%;
font-weight: normal; font-weight: normal;
@ -405,3 +409,8 @@
.colophon a { .colophon a {
color: gray; color: gray;
} }
.mywbr {
width: 0;
font-size: 1px;
}

View File

@ -52,13 +52,14 @@
(delayed-flow-element? p))) (delayed-flow-element? p)))
(provide-structs (provide-structs
[part ([tag (or/c false/c tag?)] [part ([tags (listof tag?)]
[title-content (or/c false/c list?)] [title-content (or/c false/c list?)]
[collected-info (or/c false/c collected-info?)] [collected-info (or/c false/c collected-info?)]
[to-collect list?]
[flow flow?] [flow flow?]
[parts (listof part?)])] [parts (listof part?)])]
[(styled-part part) ([style any/c])] [(styled-part part) ([style any/c])]
[(unnumbered-part part) ()] [(unnumbered-part styled-part) ()]
[flow ([paragraphs (listof flow-element?)])] [flow ([paragraphs (listof flow-element?)])]
[paragraph ([content list?])] [paragraph ([content list?])]
[(styled-paragraph paragraph) ([style any/c])] [(styled-paragraph paragraph) ([style any/c])]
@ -96,33 +97,38 @@
delayed-element-ref delayed-element-ref
delayed-element-set!) delayed-element-set!)
(make-struct-type 'delayed-element #f (make-struct-type 'delayed-element #f
2 1 #f 3 1 #f
(list (cons prop:serializable (list (cons prop:serializable
(make-serialize-info (make-serialize-info
(lambda (d) (lambda (d)
(unless (delayed-element-ref d 2) (unless (delayed-element-ref d 3)
(error 'serialize-delayed-element (error 'serialize-delayed-element
"cannot serialize a delayed element that was not resolved: ~e" "cannot serialize a delayed element that was not resolved: ~e"
d)) d))
(vector (delayed-element-ref d 2))) (vector (delayed-element-ref d 3)))
#'deserialize-delayed-element #'deserialize-delayed-element
#f #f
(or (current-load-relative-directory) (current-directory))))))) (or (current-load-relative-directory) (current-directory)))))))
(define-syntax delayed-element (list-immutable #'struct:delayed-element (define-syntax delayed-element (list-immutable #'struct:delayed-element
#'make-delayed-element #'make-delayed-element
#'delayed-element? #'delayed-element?
(list-immutable #'delayed-element-sizer (list-immutable #'delayed-element-plain
#'delayed-element-sizer
#'delayed-element-render) #'delayed-element-render)
(list-immutable #'set-delayed-element-sizer! (list-immutable #'set-delayed-element-plain!
#'set-delayed-element-sizer!
#'set-delayed-element-render!) #'set-delayed-element-render!)
#t)) #t))
(define delayed-element-render (make-struct-field-accessor delayed-element-ref 0)) (define delayed-element-render (make-struct-field-accessor delayed-element-ref 0))
(define delayed-element-sizer (make-struct-field-accessor delayed-element-ref 1)) (define delayed-element-sizer (make-struct-field-accessor delayed-element-ref 1))
(define delayed-element-plain (make-struct-field-accessor delayed-element-ref 2))
(define set-delayed-element-render! (make-struct-field-mutator delayed-element-set! 0)) (define set-delayed-element-render! (make-struct-field-mutator delayed-element-set! 0))
(define set-delayed-element-sizer! (make-struct-field-mutator delayed-element-set! 1)) (define set-delayed-element-sizer! (make-struct-field-mutator delayed-element-set! 1))
(define set-delayed-element-plain! (make-struct-field-mutator delayed-element-set! 2))
(provide/contract (provide/contract
(struct delayed-element ([render (any/c part? any/c . -> . list?)] (struct delayed-element ([render (any/c part? any/c . -> . list?)]
[sizer (-> any)]))) [sizer (-> any)]
[plain (-> any)])))
(provide deserialize-delayed-element) (provide deserialize-delayed-element)
(define deserialize-delayed-element (define deserialize-delayed-element
@ -130,14 +136,15 @@
(provide force-delayed-element) (provide force-delayed-element)
(define (force-delayed-element d renderer sec ht) (define (force-delayed-element d renderer sec ht)
(or (delayed-element-ref d 2) (or (delayed-element-ref d 3)
(let ([v ((delayed-element-ref d 0) renderer sec ht)]) (let ([v ((delayed-element-ref d 0) renderer sec ht)])
(delayed-element-set! d 2 v) (delayed-element-set! d 3 v)
v))) v)))
;; ---------------------------------------- ;; ----------------------------------------
(provide content->string) (provide content->string
element->string)
(define content->string (define content->string
(case-lambda (case-lambda
@ -154,6 +161,7 @@
[(c) [(c)
(cond (cond
[(element? c) (content->string (element-content c))] [(element? c) (content->string (element-content c))]
[(delayed-element? c) (element->string ((delayed-element-plain c)))]
[(string? c) c] [(string? c) c]
[else (case c [else (case c
[(ndash) "--"] [(ndash) "--"]

View File

@ -25,7 +25,8 @@
(parameterize ([current-directory temp-dir]) (parameterize ([current-directory temp-dir])
(for-each (lambda (name) (for-each (lambda (name)
(unless (system (format "pdflatex ~a && pdflatex ~a" (unless (system (format "pdflatex ~a && pdflatex ~a && pdflatex ~a"
name
name name
name)) name))
(error "stopped"))) (error "stopped")))

View File

@ -3,15 +3,16 @@
@title[#:tag "mz:breakhandler"]{Breaks} @title[#:tag "mz:breakhandler"]{Breaks}
@index['("threads" "breaking")]{A} @deftech{break} is an asynchronous @section-index["threads" "breaking"]
exception, usually triggered through an external source controlled by
the user, or through the @scheme[break-thread] procedure. A break A @deftech{break} is an asynchronous exception, usually triggered
exception can only occur in a thread while breaks are enabled. When a through an external source controlled by the user, or through the
break is detected and enabled, the @exnraise[exn:break] in the thread @scheme[break-thread] procedure. A break exception can only occur in a
sometime afterward; if breaking is disabled when @scheme[break-thread] thread while breaks are enabled. When a break is detected and enabled,
is called, the break is suspended until breaking is again enabled for the @exnraise[exn:break] in the thread sometime afterward; if breaking
the thread. While a thread has a suspended break, additional breaks is disabled when @scheme[break-thread] is called, the break is
are ignored. suspended until breaking is again enabled for the thread. While a
thread has a suspended break, additional breaks are ignored.
Breaks are enabled through the @scheme[break-enabled] parameter-like Breaks are enabled through the @scheme[break-enabled] parameter-like
procedure, and through the @scheme[parameterize-break] form, which is procedure, and through the @scheme[parameterize-break] form, which is

View File

@ -138,11 +138,13 @@ positions are initialized with the given @scheme[b]s.
s]} s]}
@defproc[(bytes-append [bstr bytes?] ...) bytes?]{ Returns a new @defproc[(bytes-append [bstr bytes?] ...) bytes?]{
mutable byte string that is as long as the sum of the given @scheme[bstr]s'
lengths, and that contains the concatenated bytes of the given @index["byte strings" "concatenate"]{Returns} a new mutable byte string
@scheme[bstr]s. If no @scheme[bstr]s are provided, the result is a zero-length that is as long as the sum of the given @scheme[bstr]s' lengths, and
byte string. that contains the concatenated bytes of the given @scheme[bstr]s. If
no @scheme[bstr]s are provided, the result is a zero-length byte
string.
@examples[(bytes-append #"Apple" #"Banana")]} @examples[(bytes-append #"Apple" #"Banana")]}
@ -349,11 +351,11 @@ Certain encoding combinations are always available:
to a decoding failure.} to a decoding failure.}
@item{@scheme[(bytes-open-converter "UTF-8-permissive" "UTF-8")] --- @item{@scheme[(bytes-open-converter "UTF-8-permissive" "UTF-8")] ---
the identity conversion, except that any input byte that is not @index['("UTF-8-permissive")]{the} identity conversion, except that
part of a valid encoding sequence is effectively replaced by any input byte that is not part of a valid encoding sequence is
@scheme[(char->integer #\?)]. (This handling of invalid sequences effectively replaced by @scheme[(char->integer #\?)]. (This
is consistent with the interpretation of port bytes streams into handling of invalid sequences is consistent with the interpretation
characters; see @secref["mz:ports"].)} of port bytes streams into characters; see @secref["mz:ports"].)}
@item{@scheme[(bytes-open-converter "" "UTF-8")] --- converts from @item{@scheme[(bytes-open-converter "" "UTF-8")] --- converts from
the current locale's default encoding (see @secref["mz:encodings"]) the current locale's default encoding (see @secref["mz:encodings"])
@ -454,9 +456,9 @@ The result of @scheme[bytes-convert] is three values:
@item{@scheme[_src-read-amt] --- the number of bytes successfully converted @item{@scheme[_src-read-amt] --- the number of bytes successfully converted
from @scheme[src-bstr].} from @scheme[src-bstr].}
@item{@scheme['complete], @scheme['continues], @item{@indexed-scheme['complete], @indexed-scheme['continues],
@scheme['aborts], or @scheme['error] --- indicates how @indexed-scheme['aborts], or @indexed-scheme['error] --- indicates
conversion terminated: how conversion terminated:
@itemize{ @itemize{
@ -520,7 +522,7 @@ The result of @scheme[bytes-convert-end] is two values:
@scheme[dest-bstr] is @scheme[#f] or not provided, or the number of @scheme[dest-bstr] is @scheme[#f] or not provided, or the number of
bytes written into @scheme[dest-bstr] otherwise.} bytes written into @scheme[dest-bstr] otherwise.}
@item{@scheme['complete] or @scheme['continues] --- @item{@indexed-scheme['complete] or @indexed-scheme['continues] ---
indicates whether conversion completed. If @scheme['complete], then indicates whether conversion completed. If @scheme['complete], then
an entire ending sequence was produced. If @scheme['continues], then an entire ending sequence was produced. If @scheme['continues], then
the conversion could not complete due to the limit on the result the conversion could not complete due to the limit on the result

View File

@ -205,13 +205,17 @@ inclusive.}
@defproc[(char-general-category [char char?]) boolean?]{ @defproc[(char-general-category [char char?]) boolean?]{
Returns a symbol representing the character's Unicode general Returns a symbol representing the character's Unicode general
category, which is @scheme['lu], @scheme['ll], @scheme['lt], category, which is @indexed-scheme['lu], @indexed-scheme['ll],
@scheme['lm], @scheme['lo], @scheme['mn], @scheme['mc], @scheme['me], @indexed-scheme['lt], @indexed-scheme['lm], @indexed-scheme['lo],
@scheme['nd], @scheme['nl], @scheme['no], @scheme['ps], @scheme['pe], @indexed-scheme['mn], @indexed-scheme['mc], @indexed-scheme['me],
@scheme['pi], @scheme['pf], @scheme['pd], @scheme['pc], @scheme['po], @indexed-scheme['nd], @indexed-scheme['nl], @indexed-scheme['no],
@scheme['sc], @scheme['sm], @scheme['sk], @scheme['so], @scheme['zs], @indexed-scheme['ps], @indexed-scheme['pe], @indexed-scheme['pi],
@scheme['zp], @scheme['zl], @scheme['cc], @scheme['cf], @scheme['cs], @indexed-scheme['pf], @indexed-scheme['pd], @indexed-scheme['pc],
@scheme['co], or @scheme['cn].} @indexed-scheme['po], @indexed-scheme['sc], @indexed-scheme['sm],
@indexed-scheme['sk], @indexed-scheme['so], @indexed-scheme['zs],
@indexed-scheme['zp], @indexed-scheme['zl], @indexed-scheme['cc],
@indexed-scheme['cf], @indexed-scheme['cs], @indexed-scheme['co], or
@indexed-scheme['cn].}
@defproc[(make-known-char-range-list) @defproc[(make-known-char-range-list)
(listof (list/c nonnegative-integer? (listof (list/c nonnegative-integer?

View File

@ -85,8 +85,8 @@ Produces a list of paths as follows:
executable) and it exists, then it is added to the end of the executable) and it exists, then it is added to the end of the
default collection path list.} default collection path list.}
@item{If the @envvar{PLTCOLLECTS} environment variable is defined, it @item{If the @indexed-envvar{PLTCOLLECTS} environment variable is
is combined with the default list using defined, it is combined with the default list using
@scheme[path-list-string->path-list]. If it is not defined, the @scheme[path-list-string->path-list]. If it is not defined, the
default collection path list (as constructed by the first three default collection path list (as constructed by the first three
bullets above) is used directly.} bullets above) is used directly.}

View File

@ -120,13 +120,13 @@ Returns @scheme[#t] if @scheme[v] is a mark set created by
[mark-set continuation-mark-set?]) [mark-set continuation-mark-set?])
list?]{ list?]{
Returns a list representing a ``stack trace'' for @scheme[mark-set]'s Returns a list representing a ``@index["stack dump"]{@as-index{stack
continuation. The list contains pairs, where the @scheme[car] of each trace}}'' for @scheme[mark-set]'s continuation. The list contains
pair contains either @scheme[#f] or a symbol for a procedure name, and pairs, where the @scheme[car] of each pair contains either @scheme[#f]
the @scheme[cdr] of each pair contains either @scheme[#f] or a or a symbol for a procedure name, and the @scheme[cdr] of each pair
@scheme[srcloc] value for the procedure's source location (see contains either @scheme[#f] or a @scheme[srcloc] value for the
@secref["mz:linecol"]); the @scheme[car] and @scheme[cdr] are never procedure's source location (see @secref["mz:linecol"]); the
both @scheme[#f]. @scheme[car] and @scheme[cdr] are never both @scheme[#f].
The stack-trace list is the result of The stack-trace list is the result of
@scheme[continuation-mark-set->list] with @scheme[mark-set] and @scheme[continuation-mark-set->list] with @scheme[mark-set] and

View File

@ -66,16 +66,18 @@ object, @scheme[#f] otherwise. See also @secref["mz:model-eq"].}
@guideintro["guide:symbols"]{symbols} @guideintro["guide:symbols"]{symbols}
@section-index["symbols" "generating"]
@section-index["symbols" "unique"]
A symbol is like an immutable string, but symbols are normally A symbol is like an immutable string, but symbols are normally
@deftech{interned}, so that two symbols with the same character @deftech{interned}, so that two symbols with the same character
content are normally @scheme[eq?]. All symbols produced by the default content are normally @scheme[eq?]. All symbols produced by the default
reader (see @secref["mz:parse-symbol"]) are interned. reader (see @secref["mz:parse-symbol"]) are interned.
@index['("symbols" "generating")]{@index['("symbols" "unique")]{The}} two The two procedures @scheme[string->uninterned-symbol] and
procedures @scheme[string->uninterned-symbol] and @scheme[gensym] @scheme[gensym] generate @deftech{uninterned} symbols, i.e., symbols
generate @deftech{uninterned} symbols, i.e., symbols that are not that are not @scheme[eq?], @scheme[eqv?], or @scheme[equal?] to any
@scheme[eq?], @scheme[eqv?], or @scheme[equal?] to any other symbol, other symbol, although they may print the same as other symbols.
although they may print the same as other symbols.
Regular (interned) symbols are only weakly held by the internal symbol Regular (interned) symbols are only weakly held by the internal symbol
table. This weakness can never affect the result of an @scheme[eq?], table. This weakness can never affect the result of an @scheme[eq?],
@ -466,10 +468,10 @@ must one of the following:
@itemize{ @itemize{
@item{@scheme['weak] --- creates a hash table with weakly-held @item{@indexed-scheme['weak] --- creates a hash table with weakly-held
keys (see @secref["mz:weakbox"]).} keys (see @secref["mz:weakbox"]).}
@item{@scheme['equal] --- creates a hash table that compares @item{@indexed-scheme['equal] --- creates a hash table that compares
keys using @scheme[equal?] instead of @scheme[eq?] (needed, for keys using @scheme[equal?] instead of @scheme[eq?] (needed, for
example, when using strings as keys).} example, when using strings as keys).}

View File

@ -216,9 +216,9 @@ available, the @file{.so}/@file{.dll}/@file{.dylib} file is used.
Multiple files can be combined into a single Multiple files can be combined into a single
@file{.so}/@file{.dll}/@file{.dylib} file by creating a special file @file{.so}/@file{.dll}/@file{.dylib} file by creating a special file
@file{_loader.so}, @file{_loader.dll}, or @indexed-file{_loader.so}, @indexed-file{_loader.dll}, or
@file{_loader.dylib}. When such a file is present where a normal @indexed-file{_loader.dylib}. When such a file is present where a
@file{.so}/@file{.dll}/@file{.dylib} would be loaded, then the normal @file{.so}/@file{.dll}/@file{.dylib} would be loaded, then the
@file{_loader} file is first loaded via @scheme[load-extension]. The @file{_loader} file is first loaded via @scheme[load-extension]. The
result returned by @file{_loader} must be a procedure that accepts a result returned by @file{_loader} must be a procedure that accepts a
symbol. This procedure will be called with a symbol matching the base symbol. This procedure will be called with a symbol matching the base

View File

@ -9,12 +9,14 @@
@title[#:tag "mz:sync"]{Events} @title[#:tag "mz:sync"]{Events}
@index['("select")]{@index['("poll")]{A}} @deftech{synchronizable @section-index["select"]
event} (or just @defterm{event} for short) works with the @section-index["poll"]
@scheme[sync] procedure to coordinate synchronization among
threads. Certain kinds of objects double as events, including A @deftech{synchronizable event} (or just @defterm{event} for short)
ports and threads. Other kinds of objects exist only for their works with the @scheme[sync] procedure to coordinate synchronization
use as events. among threads. Certain kinds of objects double as events, including
ports and threads. Other kinds of objects exist only for their use as
events.
At an point in time, an event is either @defterm{ready} for At an point in time, an event is either @defterm{ready} for
synchronization, or it is not; depending on the kind of event and how synchronization, or it is not; depending on the kind of event and how

View File

@ -23,12 +23,12 @@ translated on input:
@itemize{ @itemize{
@item{@scheme['binary] --- bytes are returned from the port @item{@indexed-scheme['binary] --- bytes are returned from the port
exactly as they are read from the file.} exactly as they are read from the file.}
@item{@scheme['text] --- return and linefeed bytes (10 and 13) @item{@indexed-scheme['text] --- return and linefeed bytes (10 and
as read from the file are filtered by the port in a 13) as read from the file are filtered by the port in a platform
platform specific manner: specific manner:
@itemize{ @itemize{
@ -91,22 +91,24 @@ that the file already exists.
@itemize{ @itemize{
@item{@scheme['error] --- raise @scheme[exn:fail:filesystem].} @item{@indexed-scheme['error] --- raise @scheme[exn:fail:filesystem].}
@item{@scheme['replace] --- remove the old file and write a new one.} @item{@indexed-scheme['replace] --- remove the old file and write a new one.}
@item{@scheme['truncate] --- removed all old data.} @item{@indexed-scheme['truncate] --- removed all old data.}
@item{@scheme['truncate/replace] --- try @scheme['truncate]; if it @item{@indexed-scheme['truncate/replace] --- try @scheme['truncate];
fails (perhaps due to file permissions), try @scheme['replace].} if it fails (perhaps due to file permissions), try
@scheme['replace].}
@item{@scheme['update] --- open an existing file without truncating it; @item{@indexed-scheme['update] --- open an existing file without
if the file does not exist, the @exnraise[exn:fail:filesystem].} truncating it; if the file does not exist, the
@exnraise[exn:fail:filesystem].}
@item{@scheme['append] --- append to the end of the file under @item{@indexed-scheme['append] --- append to the end of the file
@|AllUnix|; under Windows, @scheme['append] is equivalent to under @|AllUnix|; under Windows, @scheme['append] is equivalent
@scheme['update], except that the file position is immediately set to @scheme['update], except that the file position is
to the end of the file after opening it.} immediately set to the end of the file after opening it.}
} }

View File

@ -13,28 +13,29 @@ by @scheme[kind], which must be one of the following:
@itemize{ @itemize{
@item{@scheme['home-dir] --- the current user's home directory. @item{@indexed-scheme['home-dir] --- the current user's home
directory.
Under Unix and Mac OS X, this directory is determined by expanding Under Unix and Mac OS X, this directory is determined by expanding
the path @file{~}, which is expanded by first checking for a the path @file{~}, which is expanded by first checking for a
@envvar{HOME} environment variable. If none is defined, the @indexed-envvar{HOME} environment variable. If none is defined, the
@envvar{USER} and @envvar{LOGNAME} environment variables are @indexed-envvar{USER} and @indexed-envvar{LOGNAME} environment
consulted (in that order) to find a user name, and then system files variables are consulted (in that order) to find a user name, and then
are consulted to locate the user's home directory. system files are consulted to locate the user's home directory.
Under Windows, the user's home directory is the user-specific profile Under Windows, the user's home directory is the user-specific profile
directory as determined by the Windows registry. If the registry directory as determined by the Windows registry. If the registry
cannot provide a directory for some reason, the value of the cannot provide a directory for some reason, the value of the
@envvar{USERPROFILE} environment variable is used instead, as long as @indexed-envvar{USERPROFILE} environment variable is used instead, as
it refers to a directory that exists. If @envvar{USERPROFILE} also long as it refers to a directory that exists. If @envvar{USERPROFILE}
fails, the directory is the one specified by the @envvar{HOMEDRIVE} also fails, the directory is the one specified by the
and @envvar{HOMEPATH} environment variables. If those environment @indexed-envvar{HOMEDRIVE} and @indexed-envvar{HOMEPATH} environment
variables are not defined, or if the indicated directory still does variables. If those environment variables are not defined, or if the
not exist, the directory containing the current executable is used as indicated directory still does not exist, the directory containing
the home directory.} the current executable is used as the home directory.}
@item{@scheme['pref-dir] --- the standard directory for storing the @item{@indexed-scheme['pref-dir] --- the standard directory for
current user's preferences. Under Unix, the directory is storing the current user's preferences. Under Unix, the directory is
@file{.plt-scheme} in the user's home directory. Under Windows, it @file{.plt-scheme} in the user's home directory. Under Windows, it
is @file{PLT Scheme} in the user's application-data folder as is @file{PLT Scheme} in the user's application-data folder as
specified by the Windows registry; the application-data folder is specified by the Windows registry; the application-data folder is
@ -42,84 +43,86 @@ by @scheme[kind], which must be one of the following:
directory. Under Mac OS X, it is @file{Library/Preferences} in the directory. Under Mac OS X, it is @file{Library/Preferences} in the
user's home directory. This directory might not exist.} user's home directory. This directory might not exist.}
@item{@scheme['pref-file] --- a file that contains a symbol-keyed @item{@indexed-scheme['pref-file] --- a file that contains a
association list of preference values. The file's directory path symbol-keyed association list of preference values. The file's
always matches the result returned for @scheme['pref-dir]. The file directory path always matches the result returned for
name is @file{plt-prefs.ss} under Unix and Windows, and it is @scheme['pref-dir]. The file name is @file{plt-prefs.ss} under Unix
@file{org.plt-scheme.prefs.ss} under Mac OS X. The file's directory and Windows, and it is @file{org.plt-scheme.prefs.ss} under Mac OS
might not exist. See also @scheme[get-preference].} X. The file's directory might not exist. See also
@scheme[get-preference].}
@item{@scheme['temp-dir] --- the standard directory for storing @item{@indexed-scheme['temp-dir] --- the standard directory for
temporary files. Under @|AllUnix|, this is the directory specified by storing temporary files. Under @|AllUnix|, this is the directory
the @envvar{TMPDIR} environment variable, if it is defined.} specified by the @indexed-envvar{TMPDIR} environment variable, if it
is defined.}
@item{@scheme['init-dir] --- the directory containing the @item{@indexed-scheme['init-dir] --- the directory containing the
initialization file used by stand-alone @exec{mzscheme} executable. initialization file used by stand-alone @exec{mzscheme} executable.
It is the same as the current user's home directory.} It is the same as the current user's home directory.}
@item{@scheme['init-file] --- the file loaded at start-up @item{@indexed-scheme['init-file] --- the file loaded at start-up by
by the stand-alone @exec{mzscheme} executable. The directory part the stand-alone @exec{mzscheme} executable. The directory part of the
of the path is the same path as returned for @scheme['init-dir]. path is the same path as returned for @scheme['init-dir]. The file
The file name is platform-specific: name is platform-specific:
@itemize{ @itemize{
@item{@|AllUnix|: @file{.mzschemerc}} @item{@|AllUnix|: @indexed-file{.mzschemerc}}
@item{Windows: @file{mzschemerc.ss}} @item{Windows: @indexed-file{mzschemerc.ss}}
}} }}
@item{@scheme['addon-dir] --- a directory for installing PLT Scheme @item{@indexed-scheme['addon-dir] --- a directory for installing PLT Scheme
extensions. It's the same as @scheme['pref-dir], except under Mac OS extensions. It's the same as @scheme['pref-dir], except under Mac OS
X, where it is @file{Library/PLT Scheme} in the user's home X, where it is @file{Library/PLT Scheme} in the user's home
directory. This directory might not exist.} directory. This directory might not exist.}
@item{@scheme['doc-dir] --- the standard directory for storing the @item{@indexed-scheme['doc-dir] --- the standard directory for storing the
current user's documents. It's the same as @scheme['home-dir] under current user's documents. It's the same as @scheme['home-dir] under
@|AllUnix|. Under Windows, it is the user's documents folder as @|AllUnix|. Under Windows, it is the user's documents folder as
specified by the Windows registry; the documents folder is usually specified by the Windows registry; the documents folder is usually
@file{My Documents} in the user's home directory.} @file{My Documents} in the user's home directory.}
@item{@scheme['desk-dir] --- the directory for the current user's @item{@indexed-scheme['desk-dir] --- the directory for the current user's
desktop. Under Unix, it's the same as @scheme['home-dir]. Under desktop. Under Unix, it's the same as @scheme['home-dir]. Under
Windows, it is the user's desktop folder as specified by the Windows Windows, it is the user's desktop folder as specified by the Windows
registry; the documents folder is usually @file{Desktop} in the registry; the documents folder is usually @file{Desktop} in the
user's home directory. Under Mac OS X, it is the desktop directory, user's home directory. Under Mac OS X, it is the desktop directory,
which is specifically @file{~/Desktop} under Mac OS X.} which is specifically @file{~/Desktop} under Mac OS X.}
@item{@scheme['sys-dir] --- the directory containing the @item{@indexed-scheme['sys-dir] --- the directory containing the
operating system for Windows. Under @|AllUnix|, the operating system for Windows. Under @|AllUnix|, the
result is @scheme["/"].} result is @scheme["/"].}
@item{@scheme['exec-file] --- the path of the @exec{mzscheme} @item{@indexed-scheme['exec-file] --- the path of the @exec{mzscheme}
executable as provided by the operating system for the current executable as provided by the operating system for the current
invocation. invocation.
@margin-note{For MrEd, the executable path is the name of a MrEd @margin-note{For MrEd, the executable path is the name of a MrEd
executable.}} executable.}}
@item{@scheme['run-file] --- the path of the current executable; this @item{@indexed-scheme['run-file] --- the path of the current
may be different from result for @scheme['exec-file] because an executable; this may be different from result for
alternate path was provided through a @DFlag{name} or @Flag{N} @scheme['exec-file] because an alternate path was provided through a
command-line flag to the @exec{mzscheme} (or @exec{mred}) @DFlag{name} or @Flag{N} command-line flag to the @exec{mzscheme}
executable, or because an embedding executable installed an (or @exec{mred}) executable, or because an embedding executable
alternate path. In particular a ``launcher'' script created by installed an alternate path. In particular a ``launcher'' script
@scheme[make-mzscheme-launcher] sets this path to the script's created by @scheme[make-mzscheme-launcher] sets this path to the
path. In the @exec{mzscheme} executable, this path is also bound script's path. In the @exec{mzscheme} executable, this path is also
initially to @scheme[program].} bound initially to @scheme[program].}
@item{@scheme['collects-dir] --- a path to the main collection @item{@indexed-scheme['collects-dir] --- a path to the main
of libraries (see @secref["mz:collects"]). If this path is relative, it's collection of libraries (see @secref["mz:collects"]). If this path is
relative to the directory of @scheme[(find-system-path 'exec-file)]. relative, it's relative to the directory of @scheme[(find-system-path
This path is normally embedded in the @exec{mzscheme} executable, 'exec-file)]. This path is normally embedded in the @exec{mzscheme}
but it can be overridden by the @DFlag{collects} or @Flag{X} executable, but it can be overridden by the @DFlag{collects} or
command-line flag.} @Flag{X} command-line flag.}
@item{@scheme['orig-dir] --- the current directory at start-up, which @item{@indexed-scheme['orig-dir] --- the current directory at
can be useful in converting a relative-path result from start-up, which can be useful in converting a relative-path result
@scheme[(find-system-path 'exec-file)] or @scheme[(find-system-path from @scheme[(find-system-path 'exec-file)] or
'run-file)] to a complete path.} @scheme[(find-system-path 'run-file)] to a complete path.}
}} }}
@ -169,16 +172,17 @@ explored); otherwise, the result corresponds to the last link in the
chain for which @scheme[related-sub] is found. chain for which @scheme[related-sub] is found.
If @scheme[program-sub] is a pathless name, If @scheme[program-sub] is a pathless name,
@scheme[find-executable-path] gets the value of the @envvar{PATH} @scheme[find-executable-path] gets the value of the
environment variable; if this environment variable is defined, @indexed-envvar{PATH} environment variable; if this environment
@scheme[find-executable-path] tries each path in @envvar{PATH} as a variable is defined, @scheme[find-executable-path] tries each path in
prefix for @scheme[program-sub] using the search algorithm described @envvar{PATH} as a prefix for @scheme[program-sub] using the search
above for path-containing @scheme[program-sub]s. If the @envvar{PATH} algorithm described above for path-containing
environment variable is not defined, @scheme[program-sub] is prefixed @scheme[program-sub]s. If the @envvar{PATH} environment variable is
with the current directory and used in the search algorithm not defined, @scheme[program-sub] is prefixed with the current
above. (Under Windows, the current directory is always implicitly the directory and used in the search algorithm above. (Under Windows, the
first item in @envvar{PATH}, so @scheme[find-executable-path] checks current directory is always implicitly the first item in
the current directory first under Windows.)} @envvar{PATH}, so @scheme[find-executable-path] checks the current
directory first under Windows.)}
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "mz:fileutils"]{Files} @section[#:tag "mz:fileutils"]{Files}
@ -261,10 +265,10 @@ called, and the default @scheme[fail-thunk] raises
@defproc[(file-or-directory-permissions [path path-string?]) (listof symbol?)]{ @defproc[(file-or-directory-permissions [path path-string?]) (listof symbol?)]{
Returns a list containing @scheme['read], @scheme['write], and/or Returns a list containing @indexed-scheme['read],
@scheme['execute] for the given file or directory path. On error @indexed-scheme['write], and/or @indexed-scheme['execute] for the
(e.g., if no such file exists), the given file or directory path. On error (e.g., if no such file exists),
@exnraise[exn:fail:filesystem]. Under @|AllUnix|, permissions are the @exnraise[exn:fail:filesystem]. Under @|AllUnix|, permissions are
checked for the current effective user instead of the real user.} checked for the current effective user instead of the real user.}
@defproc[(file-size [path path-string?]) nonnegative-exact-integer?]{ @defproc[(file-size [path path-string?]) nonnegative-exact-integer?]{

View File

@ -568,6 +568,8 @@ by prefixes.
@;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@subsection[#:tag "mz:module-redeclare"]{Module Re-declarations} @subsection[#:tag "mz:module-redeclare"]{Module Re-declarations}
@section-index["modules" "re-define"]
When a module is declared using a name for which a module is already When a module is declared using a name for which a module is already
declared, the new declaration's definitions replace and extend the old declared, the new declaration's definitions replace and extend the old
declarations. If a variable in the old declaration has no counterpart declarations. If a variable in the old declaration has no counterpart

View File

@ -28,14 +28,14 @@ is an option that determines the initial bindings in the namespace:
@itemize{ @itemize{
@item{@scheme['initial] --- the new namespace contains the module @item{@indexed-scheme['initial] --- the new namespace contains the
declarations of the initial namespace, and the new namespace's module declarations of the initial namespace, and the new
@tech{phase-level} 1 top-level environment contains bindings and namespace's @tech{phase-level} 1 top-level environment contains
imports as in the initial namespace. However, the namespace's bindings and imports as in the initial namespace. However, the
@tech{phase-level} 1 top-level environment is empty.} namespace's @tech{phase-level} 1 top-level environment is empty.}
@item{@scheme['empty] --- creates a namespace with no initial @item{@indexed-scheme['empty] --- creates a namespace with no
bindings or module declarations.} initial bindings or module declarations.}
}} }}

View File

@ -26,10 +26,10 @@ and an inexact imaginary part; a complex number with an zero imaginary
part (inexact or exact) is a real number. part (inexact or exact) is a real number.
Inexact real numbers are implemented as either single- or Inexact real numbers are implemented as either single- or
double-precision IEEE floating-point numbers---the latter by default, double-precision @as-index{IEEE floating-point numbers}---the latter
and the former only when support for 32-bit inexact numbers is by default, and the former only when support for 32-bit inexact
specifically enabled when the run-time system is built, and when numbers is specifically enabled when the run-time system is built, and
computation starts with numerical constants specified as when computation starts with numerical constants specified as
single-precision numbers. single-precision numbers.
The precision and size of exact numbers is limited only by available The precision and size of exact numbers is limited only by available
@ -37,20 +37,21 @@ memory (and the precision of operations that can produce irrational
numbers). In particular, adding, multiplying, subtracting, and numbers). In particular, adding, multiplying, subtracting, and
dividing exact numbers always produces an extract result. dividing exact numbers always produces an extract result.
@index["division by inexact zero"]{Inexact} numbers can be coerced to Inexact numbers can be coerced to exact form, except for the inexact
exact form, except for the inexact numbers @as-index{@scheme[+inf.0]} numbers @as-index{@scheme[+inf.0]} (positive @as-index{infinity}),
(positive infinity), @as-index{@scheme[-inf.0]} (negative infinity), and @as-index{@scheme[-inf.0]} (negative infinity), and
@as-index{@scheme[+nan.0]} (not-a-number), which have no exact @as-index{@scheme[+nan.0]} (@as-index{not-a-number}), which have no
form. Dividing a number by exact zero raises an exception; dividing a exact form. @index["division by inexact zero"]{Dividing} a number by
non-zero number other than @scheme[+nan.0] by an inexact zero returns exact zero raises an exception; dividing a non-zero number other than
@scheme[+inf.0] or @scheme[-inf.0], depending on the sign of the @scheme[+nan.0] by an inexact zero returns @scheme[+inf.0] or
dividend. The infinities @scheme[+inf.0] and @scheme[-inf.0] are @scheme[-inf.0], depending on the sign of the dividend. The
integers, and they answer @scheme[#t] for both @scheme[even?] and infinities @scheme[+inf.0] and @scheme[-inf.0] are integers, and they
@scheme[odd?]. The @scheme[+nan.0] value is not an integer and is not answer @scheme[#t] for both @scheme[even?] and @scheme[odd?]. The
@scheme[=] to itself, but @scheme[+nan.0] is @scheme[eqv?] to @scheme[+nan.0] value is not an integer and is not @scheme[=] to
itself. Conversely, @scheme[(= 0.0 -0.0)] is @scheme[#t], but itself, but @scheme[+nan.0] is @scheme[eqv?] to itself. Conversely,
@scheme[(eqv? 0.0 -0.0)] is @scheme[#f]. The datum @scheme[-nan.0] @scheme[(= 0.0 -0.0)] is @scheme[#t], but @scheme[(eqv? 0.0 -0.0)] is
refers to the same constant as @scheme[+nan.0]. @scheme[#f]. The datum @scheme[-nan.0] refers to the same constant as
@scheme[+nan.0].
Calculations with infinites produce results consistent with IEEE Calculations with infinites produce results consistent with IEEE
double-precision floating point where IEEE specifies the result; in double-precision floating point where IEEE specifies the result; in
@ -479,6 +480,8 @@ noted above). Two numbers are @scheme[equal?] when they are
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section{Bitwise Operations} @section{Bitwise Operations}
@section-index{logical operators}
@defproc[(bitwise-ior [n exact-integer?] ...) exact-integer?]{ Returns @defproc[(bitwise-ior [n exact-integer?] ...) exact-integer?]{ Returns
the bitwise ``inclusive or'' of the @scheme[n]s in their (semi-infinite) the bitwise ``inclusive or'' of the @scheme[n]s in their (semi-infinite)
two's complement representation. If no arguments are provided, the two's complement representation. If no arguments are provided, the
@ -600,6 +603,12 @@ one of the last three integers must be non-zero.}
@; ------------------------------------------------------------------------ @; ------------------------------------------------------------------------
@section{Number--String Conversions} @section{Number--String Conversions}
@section-index["numbers" "machine representations"]
@section-index["numbers" "floating-point"]
@section-index["numbers" "big-endian"]
@section-index["numbers" "little-endian"]
@section-index["numbers" "converting"]
@defproc[(number->string [z number?] @defproc[(number->string [z number?]
[radix (one-of/c 2 8 10 16) 10]) string?]{ [radix (one-of/c 2 8 10 16) 10]) string?]{
Returns a string that is the printed form of @scheme[z] Returns a string that is the printed form of @scheme[z]

View File

@ -194,7 +194,8 @@ type.}
(one-of 'unix 'windows)]{ (one-of 'unix 'windows)]{
Returns the path convention type of the current platform: Returns the path convention type of the current platform:
@scheme['unix] for @|AllUnix|, @scheme['windows] for Windows.} @indexed-scheme['unix] for @|AllUnix|, @indexed-scheme['windows] for
Windows.}
@defproc[(build-path [base path-string?] @defproc[(build-path [base path-string?]
@ -208,12 +209,12 @@ absolute path; if @scheme[base] is a relative path, the result is a
relative path. relative path.
Each @scheme[sub] must be either a relative path, the symbol Each @scheme[sub] must be either a relative path, the symbol
@scheme['up] (indicating the relative parent directory), or the symbol @indexed-scheme['up] (indicating the relative parent directory), or
@scheme['same] (indicating the relative current directory). For the symbol @indexed-scheme['same] (indicating the relative current
Windows paths, if @scheme[base] is a drive specification (with or directory). For Windows paths, if @scheme[base] is a drive
without a trailing slash) the first @scheme[sub] can be an absolute specification (with or without a trailing slash) the first
(driveless) path. For all platforms, the last @scheme[sub] can be a @scheme[sub] can be an absolute (driveless) path. For all platforms,
filename. the last @scheme[sub] can be a filename.
The @scheme[base] and @scheme[sub-paths] arguments can be paths for The @scheme[base] and @scheme[sub-paths] arguments can be paths for
any platform. The platform for the resulting path is inferred from the any platform. The platform for the resulting path is inferred from the
@ -428,8 +429,8 @@ directory or file name. Three values are returned:
@itemize{ @itemize{
@item{a path,} @item{a path,}
@item{@scheme['relative] if @scheme[path] is an immediate relative directory @item{@indexed-scheme['relative] if @scheme[path] is an immediate
or filename, or} relative directory or filename, or}
@item{@scheme[#f] if @scheme[path] is a root directory.} @item{@scheme[#f] if @scheme[path] is a root directory.}
}} }}

View File

@ -65,10 +65,11 @@ TCP ports (see @secref["mz:networking"]) support setting and getting
the buffer mode, and custom ports (see @secref["mz:customport"]) may the buffer mode, and custom ports (see @secref["mz:customport"]) may
support getting and setting buffer modes. support getting and setting buffer modes.
If @scheme[mode] is provided, it must be one of @scheme['none], If @scheme[mode] is provided, it must be one of
@scheme['line] (output only), or @scheme['block], and the port's @indexed-scheme['none], @indexed-scheme['line] (output only), or
buffering is set accordingly. If the port does not support setting the @indexed-scheme['block], and the port's buffering is set
mode, the @exnraise[exn:fail]. accordingly. If the port does not support setting the mode, the
@exnraise[exn:fail].
If @scheme[mode] is not provided, the current mode is returned, or If @scheme[mode] is not provided, the current mode is returned, or
@scheme[#f] is returned if the mode cannot be determined. If @scheme[#f] is returned if the mode cannot be determined. If

View File

@ -3,11 +3,12 @@
@title[#:tag "mz:linecol"]{Counting Positions, Lines, and Columns} @title[#:tag "mz:linecol"]{Counting Positions, Lines, and Columns}
@index['("line numbers")]{ @section-index["line numbers"]
@index['("column numbers")]{ @section-index["column numbers"]
@index['("port positions")]{ @section-index["port positions"]
By}}} default, Scheme keeps track of the @deftech{position} in a port as the
number of bytes that have been read from or written to any port By default, Scheme keeps track of the @deftech{position} in a port as
the number of bytes that have been read from or written to any port
(independent of the read/write position, which is accessed or changed (independent of the read/write position, which is accessed or changed
with @scheme[file-position]). Optionally, however, Scheme can track with @scheme[file-position]). Optionally, however, Scheme can track
the position in terms of characters (after UTF-8 decoding), instead of the position in terms of characters (after UTF-8 decoding), instead of

View File

@ -28,8 +28,6 @@ terms of Unicode characters; see @secref["mz:ports"] for information
on how a character stream is written to an port's underlying byte on how a character stream is written to an port's underlying byte
stream. stream.
@local-table-of-contents[]
@section[#:tag "mz:print-symbol"]{Printing Symbols} @section[#:tag "mz:print-symbol"]{Printing Symbols}
Symbols containing spaces or special characters @scheme[write] using Symbols containing spaces or special characters @scheme[write] using

View File

@ -41,8 +41,6 @@ Reading is defined in terms of Unicode characters; see
@secref["mz:ports"] for information on how a byte stream is converted @secref["mz:ports"] for information on how a byte stream is converted
to a character stream. to a character stream.
@local-table-of-contents[]
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "mz:default-readtable-dispatch"]{Delimiters and Dispatch} @section[#:tag "mz:default-readtable-dispatch"]{Delimiters and Dispatch}
@ -169,14 +167,16 @@ never parsed as a symbol or character (unless the
@as-index{@litchar{#%}} also starts a symbol. A successful number @as-index{@litchar{#%}} also starts a symbol. A successful number
parse takes precedence over a symbol parse. parse takes precedence over a symbol parse.
When the @scheme[read-case-sensitive] @tech{parameter} is set to @scheme[#f], @index["case-sensitivity"]{@index["case-insensitive"]{When}} the
@scheme[read-case-sensitive] @tech{parameter} is set to @scheme[#f],
characters in the sequence that are not quoted by @litchar["|"] or characters in the sequence that are not quoted by @litchar["|"] or
@litchar["\\"] are first case-normalized. If the reader encounters @litchar["\\"] are first case-normalized. If the reader encounters
@as-index{@litchar{#ci}}, @litchar{#CI}, @litchar{#Ci}, or @litchar{#cI}, @as-index{@litchar{#ci}}, @litchar{#CI}, @litchar{#Ci}, or
then it recursively reads the following datum in @litchar{#cI}, then it recursively reads the following datum in
case-insensitive mode. If the reader encounters @as-index{@litchar{#cs}}, case-insensitive mode. If the reader encounters
@litchar{#CS}, @litchar{#Cs}, or @litchar{#cS}, then recursively reads @as-index{@litchar{#cs}}, @litchar{#CS}, @litchar{#Cs}, or
the following datum in case-sensitive mode. @litchar{#cS}, then recursively reads the following datum in
case-sensitive mode.
@reader-examples[#:symbols? #f @reader-examples[#:symbols? #f
"Apple" "Apple"
@ -195,10 +195,12 @@ the following datum in case-sensitive mode.
@guideintro["guide:numbers"]{the syntax of numbers} @guideintro["guide:numbers"]{the syntax of numbers}
@index['("numbers" "parsing")]{A} sequence that does not start with a @section-index["numbers" "parsing"]
delimiter is parsed as a number when it matches the following grammar
case-insenstively for @nonterm{number@sub{10}} (decimal), where A sequence that does not start with a delimiter is parsed as a number
@metavar{n} is a meta-meta-variable in the grammar. when it matches the following grammar case-insenstively for
@nonterm{number@sub{10}} (decimal), where @metavar{n} is a
meta-meta-variable in the grammar.
A number is optionally prefixed by an exactness specifier, A number is optionally prefixed by an exactness specifier,
@as-index{@litchar{#e}} (exact) or @as-index{@litchar{#i}} (inexact), @as-index{@litchar{#e}} (exact) or @as-index{@litchar{#i}} (inexact),
@ -319,8 +321,7 @@ parentheses, and if a pair of delimited @litchar{.}s surrounds any
other than the first and last elements, the result is a list other than the first and last elements, the result is a list
containing the element surrounded by @litchar{.}s as the first containing the element surrounded by @litchar{.}s as the first
element, followed by the others in the read order. This convention element, followed by the others in the read order. This convention
supports a kind of @index["infix"]{infix} notation at the reader supports a kind of @as-index{infix} notation at the reader level.
level.
In @scheme[read-syntax] mode, the recursive reads for the pair/list In @scheme[read-syntax] mode, the recursive reads for the pair/list
elements are themselves in @scheme[read-syntax] mode, so that the elements are themselves in @scheme[read-syntax] mode, so that the
@ -329,10 +330,11 @@ syntax object. If the reader constructs nested pairs because the input
included a single delimited @litchar{.}, then only the innermost pair included a single delimited @litchar{.}, then only the innermost pair
and outtermost pair are wrapped as syntax objects. Whether wrapping a and outtermost pair are wrapped as syntax objects. Whether wrapping a
pair or list, if the pair or list was formed with @litchar{[} and pair or list, if the pair or list was formed with @litchar{[} and
@litchar{]}, then a @scheme['paren-shape] property is attached to the @litchar{]}, then a @indexed-scheme['paren-shape] property is attached
result with the value @scheme[#\[];if the list or pair was formed with to the result with the value @scheme[#\[];if the list or pair was
@litchar["{"] and @litchar["}"], then a @scheme['paren-shape] property formed with @litchar["{"] and @litchar["}"], then a
is attached to the result with the value @scheme[#\{]. @scheme['paren-shape] property is attached to the result with the
value @scheme[#\{].
If a delimited @litchar{.} appears in any other configuration, then If a delimited @litchar{.} appears in any other configuration, then
the @exnraise[exn:fail:read]. Similarly, if the reader encounters a the @exnraise[exn:fail:read]. Similarly, if the reader encounters a
@ -368,10 +370,12 @@ conversion.
@guideintro["guide:strings"]{the syntax of strings} @guideintro["guide:strings"]{the syntax of strings}
@index['("strings" "parsing")]{When} the reader encouters @section-index["strings" "parsing"]
@as-index{@litchar{"}}, it begins parsing characters to form a string. The
string continues until it is terminated by another @litchar{"} (that When the reader encounters @as-index{@litchar{"}}, it begins parsing
is not escaped by @litchar["\\"]). characters to form a string. The string continues until it is
terminated by another @litchar{"} (that is not escaped by
@litchar["\\"]).
Within a string sequence, the following escape sequences are Within a string sequence, the following escape sequences are
recognized: recognized:
@ -437,12 +441,13 @@ constant, the @exnraise[exn:fail:read].
@guideintro["guide:bytestrings"]{the syntax of byte strings} @guideintro["guide:bytestrings"]{the syntax of byte strings}
@index['("byte strings" "parsing")]{A} string constant preceded by @section-index["byte strings" "parsing"]
@litchar{#} is parsed as a byte-string. (That is, @as-index{@litchar{#"}} starts
a byte-string literal.) See @secref["mz:bytestrings"] for A string constant preceded by @litchar{#} is parsed as a
information on byte strings. Byte string constants support the same byte-string. (That is, @as-index{@litchar{#"}} starts a byte-string
escape sequences as character strings, except @litchar["\\u"] and literal.) See @secref["mz:bytestrings"] for information on byte
@litchar["\\U"]. strings. Byte string constants support the same escape sequences as
character strings, except @litchar["\\u"] and @litchar["\\U"].
When the reader encounters @as-index{@litchar{#<<}}, it starts parsing a When the reader encounters @as-index{@litchar{#<<}}, it starts parsing a
@pidefterm{here string}. The characters following @litchar{#<<} until @pidefterm{here string}. The characters following @litchar{#<<} until

View File

@ -85,7 +85,7 @@ The possible combinations for @scheme[key], @scheme[mode], and
@itemize{ @itemize{
@item{@scheme[(code:line _char 'terminating-macro _proc)] --- causes @item{@scheme[(code:line _char (unsyntax @indexed-scheme['terminating-macro]) _proc)] --- causes
@scheme[_char] to be parsed as a delimiter, and an @scheme[_char] to be parsed as a delimiter, and an
unquoted/uncommented @scheme[_char] in the input string triggers a unquoted/uncommented @scheme[_char] in the input string triggers a
call to the @deftech{reader macro} @scheme[_proc]; the activity of call to the @deftech{reader macro} @scheme[_proc]; the activity of
@ -93,13 +93,13 @@ The possible combinations for @scheme[key], @scheme[mode], and
like @litchar{;}, @litchar{(}, and @litchar{)} are mapped to like @litchar{;}, @litchar{(}, and @litchar{)} are mapped to
terminating reader macros in the default readtable.} terminating reader macros in the default readtable.}
@item{@scheme[(code:line _char 'non-terminating-macro _proc)] --- like @item{@scheme[(code:line _char (unsyntax @indexed-scheme['non-terminating-macro]) _proc)] --- like
the @scheme['terminating-macro] variant, but @scheme[_char] is not the @scheme['terminating-macro] variant, but @scheme[_char] is not
treated as a delimiter, so it can be used in the middle of an treated as a delimiter, so it can be used in the middle of an
identifier or number. Conceptually, @litchar{#} is mapped to a identifier or number. Conceptually, @litchar{#} is mapped to a
non-terminating macro in the default readtable.} non-terminating macro in the default readtable.}
@item{@scheme[(code:line _char 'dispatch-macro _proc)] --- like the @item{@scheme[(code:line _char (unsyntax @indexed-scheme['dispatch-macro]) _proc)] --- like the
@scheme['non-terminating-macro] variant, but for @scheme[_char] only @scheme['non-terminating-macro] variant, but for @scheme[_char] only
when it follows a @litchar{#} (or, more precisely, when the character when it follows a @litchar{#} (or, more precisely, when the character
follows one that has been mapped to the behavior of @litchar{#}hash follows one that has been mapped to the behavior of @litchar{#}hash
@ -121,7 +121,7 @@ The possible combinations for @scheme[key], @scheme[mode], and
that the character is disallowed when the that the character is disallowed when the
@scheme[read-curly-brace-as-paren] parameter is set to @scheme[#f].} @scheme[read-curly-brace-as-paren] parameter is set to @scheme[#f].}
@item{@scheme[(code:line #f 'non-terminating-macro _proc)] --- @item{@scheme[(code:line #f (unsyntax @indexed-scheme['non-terminating-macro]) _proc)] ---
replaces the macro used to parse characters with no specific mapping: replaces the macro used to parse characters with no specific mapping:
i.e., characters (other than @litchar{#} or @litchar{|}) that can i.e., characters (other than @litchar{#} or @litchar{|}) that can
start a symbol or number with the default readtable.} start a symbol or number with the default readtable.}

View File

@ -6,13 +6,10 @@
@title[#:tag "mz:regexp"]{Regular Expressions} @title[#:tag "mz:regexp"]{Regular Expressions}
@;{ @section-index{regexps}
\index{regular expressions} @section-index{pattern matching}
\index{regexps|see{regular expressions}} @section-index["strings" "pattern matching"]
\index{pattern matching} @section-index["input ports" "pattern matching"]
\index{strings!pattern matching}
\index{input ports!pattern matching}
}
Regular expressions are specified as strings or byte strings, using Regular expressions are specified as strings or byte strings, using
the same pattern language as the Unix utility @exec{egrep} or Perl. A the same pattern language as the Unix utility @exec{egrep} or Perl. A

View File

@ -25,43 +25,43 @@ contain a null character; the environment variable named by
Returns information about the operating system, build mode, or machine Returns information about the operating system, build mode, or machine
for a running Scheme. for a running Scheme.
In @scheme['os] mode, In @indexed-scheme['os] mode,
the possible symbol results are: the possible symbol results are:
@itemize{ @itemize{
@item{@scheme['unix]} @item{@indexed-scheme['unix]}
@item{@scheme['windows]} @item{@indexed-scheme['windows]}
@item{@scheme['macosx]} @item{@indexed-scheme['macosx]}
} }
In @scheme['gc] mode, In @indexed-scheme['gc] mode,
the possible symbol results are: the possible symbol results are:
@itemize{ @itemize{
@item{@scheme['cgc]} @item{@indexed-scheme['cgc]}
@item{@scheme['3m]} @item{@indexed-scheme['3m]}
} }
In @scheme['link] mode, the possible symbol results are: In @indexed-scheme['link] mode, the possible symbol results are:
@itemize{ @itemize{
@item{@scheme['static] (Unix)} @item{@indexed-scheme['static] (Unix)}
@item{@scheme['shared] (Unix)} @item{@indexed-scheme['shared] (Unix)}
@item{@scheme['dll] (Windows)} @item{@indexed-scheme['dll] (Windows)}
@item{@scheme['framework] (Mac OS X)} @item{@indexed-scheme['framework] (Mac OS X)}
} }
Future ports of Scheme may expand the list of @scheme['os], Future ports of Scheme may expand the list of @scheme['os],
@scheme['gc], and @scheme['link] results. @scheme['gc], and @scheme['link] results.
In @scheme['so-suffix] mode, then the result is a byte string that In @indexed-scheme['so-suffix] mode, then the result is a byte string
represents the file extension used for shared objects on the current that represents the file extension used for shared objects on the
platform. The byte string starts with a period, so it is suitable as a current platform. The byte string starts with a period, so it is
second argument to @scheme[path-replace-suffix]. suitable as a second argument to @scheme[path-replace-suffix].
In @scheme['machine] mode, then the result is a string, which contains In @indexed-scheme['machine] mode, then the result is a string, which
further details about the current machine in a platform-specific contains further details about the current machine in a
format.} platform-specific format.}
@defproc[(system-language+country) string?]{ @defproc[(system-language+country) string?]{
@ -75,13 +75,13 @@ letters for the country. Under Windows, the string can be arbitrarily
long, but the language and country are in English (all ASCII letters long, but the language and country are in English (all ASCII letters
or spaces) separated by an underscore. or spaces) separated by an underscore.
Under Unix, the result is determined by checking the @envvar{LC_ALL}, Under Unix, the result is determined by checking the
@envvar{LC_TYPE}, and @envvar{LANG} environment variables, in that @indexed-envvar{LC_ALL}, @indexed-envvar{LC_TYPE}, and
order (and the result is used if the environment variable's value @indexed-envvar{LANG} environment variables, in that order (and the
starts with two lowercase ASCII letters, an underscore, and two result is used if the environment variable's value starts with two
uppercase ASCII letters, followed by either nothing or a lowercase ASCII letters, an underscore, and two uppercase ASCII
period). Under Windows and Mac OS X, the result is determined by letters, followed by either nothing or a period). Under Windows and
system calls.} Mac OS X, the result is determined by system calls.}
@defproc[(system-library-subpath [mode (one-of 'cgc '3m #f) @defproc[(system-library-subpath [mode (one-of 'cgc '3m #f)

View File

@ -64,16 +64,16 @@ The @scheme[file-guard] procedure must accept three arguments:
@itemize{ @itemize{
@item{@scheme['read] --- read a file or directory} @item{@indexed-scheme['read] --- read a file or directory}
@item{@scheme['write] --- modify or create a file or @item{@indexed-scheme['write] --- modify or create a file or
directory} directory}
@item{@scheme['execute] --- execute a file} @item{@indexed-scheme['execute] --- execute a file}
@item{@scheme['delete] --- delete a file or directory} @item{@indexed-scheme['delete] --- delete a file or directory}
@item{@scheme['exists] --- determine whether a file or @item{@indexed-scheme['exists] --- determine whether a file or
directory exists, or that a path string is well-formed} directory exists, or that a path string is well-formed}
} }
@ -104,11 +104,12 @@ The @scheme[network-guard] procedure must accept four arguments:
number is the target port on the server. For a listening server, the number is the target port on the server. For a listening server, the
port number is the local port number.} port number is the local port number.}
@item{a symbol, either @scheme['client] or @scheme['server], @item{a symbol, either @indexed-scheme['client] or
indicating whether the check is for the creation of a client @indexed-scheme['server], indicating whether the check is for the
connection or a listening server. The opening of an unbound UDP creation of a client connection or a listening server. The opening of
socket is identified as a @scheme['client] connection; explicitly an unbound UDP socket is identified as a @scheme['client] connection;
binding the socket is identified as a @scheme['server] action.} explicitly binding the socket is identified as a @scheme['server]
action.}
} }

View File

@ -38,22 +38,22 @@ must be one of the following symbols:
@itemize{ @itemize{
@item{@scheme['linefeed] breaks lines on linefeed characters.} @item{@indexed-scheme['linefeed] breaks lines on linefeed characters.}
@item{@scheme['return] breaks lines on return characters.} @item{@indexed-scheme['return] breaks lines on return characters.}
@item{@scheme['return-linefeed] breaks lines on @item{@indexed-scheme['return-linefeed] breaks lines on
return-linefeed combinations. If a return character is not followed return-linefeed combinations. If a return character is not followed
by a linefeed character, it is included in the result string; by a linefeed character, it is included in the result string;
similarly, a linefeed that is not preceded by a return is included similarly, a linefeed that is not preceded by a return is included
in the result string.} in the result string.}
@item{@scheme['any] breaks lines on any of a return @item{@indexed-scheme['any] breaks lines on any of a return
character, linefeed character, or return-linefeed combination. If a character, linefeed character, or return-linefeed combination. If a
return character is followed by a linefeed character, the two are return character is followed by a linefeed character, the two are
treated as a combination.} treated as a combination.}
@item{@scheme['any-one] breaks lines on either a return or @item{@indexed-scheme['any-one] breaks lines on either a return or
linefeed character, without recognizing return-linefeed linefeed character, without recognizing return-linefeed
combinations.} combinations.}

View File

@ -131,11 +131,12 @@ Returns an immutable string with the same content as
s]} s]}
@defproc[(string-append [str string?] ...) string?]{ Returns a new @defproc[(string-append [str string?] ...) string?]{
mutable string that is as long as the sum of the given @scheme[str]s'
lengths, and that contains the concatenated characters of the given @index["strings" "concatenate"]{Returns} a new mutable string that is
@scheme[str]s. If no @scheme[str]s are provided, the result is a zero-length as long as the sum of the given @scheme[str]s' lengths, and that
string. contains the concatenated characters of the given @scheme[str]s. If no
@scheme[str]s are provided, the result is a zero-length string.
@examples[(string-append "Apple" "Banana")]} @examples[(string-append "Apple" "Banana")]}

View File

@ -51,8 +51,8 @@ not exist.
values are @scheme[equal?] if they are @scheme[eq?], or if they are values are @scheme[equal?] if they are @scheme[eq?], or if they are
instances of the same structure type, no fields are opaque, and the instances of the same structure type, no fields are opaque, and the
results of applying @scheme[struct->vector] to the structs are results of applying @scheme[struct->vector] to the structs are
@scheme[equal?]. (Consequently, @scheme[equal?] testing for structures @scheme[equal?]. (Consequently, @scheme[equal?] testing for
depends on the current inspector.) structures depends on the current inspector.)
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@include-section["define-struct.scrbl"] @include-section["define-struct.scrbl"]
@ -222,11 +222,11 @@ For examples, see @scheme[make-struct-type].}
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "mz:structprops"]{Structure Type Properties} @section[#:tag "mz:structprops"]{Structure Type Properties}
A @index['("structure type properties")]{@deftech{structure type A @deftech{structure type property} allows per-type information to be
property}} allows per-type information to be associated with a associated with a structure type (as opposed to per-instance
structure type (as opposed to per-instance information associated information associated with a structure value). A property value is
with a structure value). A property value is associated with a associated with a structure type through the
structure type through the @scheme[make-struct-type] procedure (see @scheme[make-struct-type] procedure (see
@secref["mz:creatingmorestructs"]) or through the @scheme[#:property] @secref["mz:creatingmorestructs"]) or through the @scheme[#:property]
option of @scheme[define-struct]. Subtypes inherit the property option of @scheme[define-struct]. Subtypes inherit the property
values of their parent types, and subtypes can override an inherited values of their parent types, and subtypes can override an inherited

View File

@ -38,12 +38,13 @@ shape and properties of the result:
@itemize{ @itemize{
@item{If the result has a @scheme['certify-mode] property (see @item{If the result has a @indexed-scheme['certify-mode] property
@secref["mz:stxprops"]) that is @scheme['opaque], then the (see @secref["mz:stxprops"]) that is
certificate is attached to the immediate syntax object.} @indexed-scheme['opaque], then the certificate is attached
to the immediate syntax object.}
@item{If the result has a @scheme['certify-mode] property that is @item{If the result has a @scheme['certify-mode] property that is
@scheme['transparent], then the certificate is also @indexed-scheme['transparent], then the certificate is also
propagated recursively to syntax object that corresponds to propagated recursively to syntax object that corresponds to
elements of the syntax object's datum as a list (or, more elements of the syntax object's datum as a list (or, more
precisely, to the @scheme[car]s of the datum as reached by precisely, to the @scheme[car]s of the datum as reached by
@ -52,8 +53,8 @@ shape and properties of the result:
attachment.} attachment.}
@item{If the result has a @scheme['certify-mode] property that is @item{If the result has a @scheme['certify-mode] property that is
@scheme['transparent-binding], then the certificate is @indexed-scheme['transparent-binding], then the certificate
attached to similar to @scheme['transparent], but further is attached to similar to @scheme['transparent], but further
treating the syntax object corresponding to the second list treating the syntax object corresponding to the second list
element as having a @scheme['transparent] value for the element as having a @scheme['transparent] value for the
@scheme['certify-mode] property if it does not already have @scheme['certify-mode] property if it does not already have

View File

@ -58,8 +58,8 @@ Returns one of three kinds of values, depending on the binding of
@itemize{ @itemize{
@item{The result is @scheme['lexical] if @scheme[id-stx] has @item{The result is @indexed-scheme['lexical] if @scheme[id-stx]
a @tech{local binding}. has a @tech{local binding}.
@item{The result is a list of five items when @scheme[id-stx] @item{The result is a list of five items when @scheme[id-stx]
has a @tech{module binding}: @scheme[(list source-mod source-id has a @tech{module binding}: @scheme[(list source-mod source-id

View File

@ -72,20 +72,20 @@ to the syntax object:
@itemize{ @itemize{
@item{@scheme['module-direct-requires] --- a list of @item{@indexed-scheme['module-direct-requires] --- a list of
@tech{module path index}es (or symbols) representing the modules explicitly
imported into the module.}
@item{@scheme['module-direct-for-syntax-requires] --- a list of
@tech{module path index}es (or symbols) representing the modules explicitly
for-syntax imported into the module.}
@item{@scheme['module-direct-for-template-requires] --- a list of
@tech{module path index}es (or symbols) representing the modules @tech{module path index}es (or symbols) representing the modules
explicitly for-template imported into the module.} explicitly imported into the module.}
@item{@scheme['module-variable-provides] --- a list of provided @item{@indexed-scheme['module-direct-for-syntax-requires] --- a list
items, where each item is one of the following: of @tech{module path index}es (or symbols) representing the modules
explicitly for-syntax imported into the module.}
@item{@indexed-scheme['module-direct-for-template-requires] --- a
list of @tech{module path index}es (or symbols) representing the
modules explicitly for-template imported into the module.}
@item{@indexed-scheme['module-variable-provides] --- a list of
provided items, where each item is one of the following:
@itemize{ @itemize{
@ -108,11 +108,11 @@ to the syntax object:
}} }}
@item{@scheme['module-syntax-provides] --- like @item{@indexed-scheme['module-syntax-provides] --- like
@scheme['module-variable-provides], but for syntax exports instead of @scheme['module-variable-provides], but for syntax exports instead of
variable exports.} variable exports.}
@item{@scheme['module-indirect-provides] --- a list of symbols for @item{@indexed-scheme['module-indirect-provides] --- a list of symbols for
variables that are defined in the module but not exported; they may variables that are defined in the module but not exported; they may
be exported indirectly through macro expansions. Definitions of be exported indirectly through macro expansions. Definitions of
macro-generated identifiers create uninterned symbols in this list.} macro-generated identifiers create uninterned symbols in this list.}

View File

@ -26,17 +26,17 @@ value first, original value second).
Before performing the merge, however, the syntax expander Before performing the merge, however, the syntax expander
automatically adds a property to the original syntax object using the automatically adds a property to the original syntax object using the
key @scheme['origin]. If the source syntax has no @scheme['origin] key @indexed-scheme['origin]. If the source syntax has no
property, it is set to the empty list. Then, still before the merge, @scheme['origin] property, it is set to the empty list. Then, still
the identifier that triggered the macro expansion (as syntax) is before the merge, the identifier that triggered the macro expansion
@scheme[cons-immutable]d onto the @scheme['origin] property so far. (as syntax) is @scheme[cons-immutable]d onto the @scheme['origin]
The @scheme['origin] property thus records (in reverse order) the property so far. The @scheme['origin] property thus records (in
sequence of macro expansions that produced an expanded reverse order) the sequence of macro expansions that produced an
expression. Usually, the @scheme['origin] value is an immutable list expanded expression. Usually, the @scheme['origin] value is an
of identifiers. However, a transformer might return syntax that has immutable list of identifiers. However, a transformer might return
already been expanded, in which case an @scheme['origin] list can syntax that has already been expanded, in which case an
contain other lists after a merge. The @scheme[syntax-track-origin] @scheme['origin] list can contain other lists after a merge. The
procedure implements this tracking. @scheme[syntax-track-origin] procedure implements this tracking.
Besides @scheme['origin] tracking for general macro expansion, Besides @scheme['origin] tracking for general macro expansion,
MzScheme adds properties to expanded syntax (often using MzScheme adds properties to expanded syntax (often using
@ -68,18 +68,18 @@ MzScheme adds properties to expanded syntax (often using
the body contained multiple expressions). To record the disappeared the body contained multiple expressions). To record the disappeared
syntax bindings, a property is added to the expansion result: an syntax bindings, a property is added to the expansion result: an
immutable list of identifiers from the disappeared bindings, as a immutable list of identifiers from the disappeared bindings, as a
@scheme['disappeared-binding] property.} @indexed-scheme['disappeared-binding] property.}
@item{When a subtyping @scheme[define-struct] form is expanded, the @item{When a subtyping @scheme[define-struct] form is expanded, the
identifier used to reference the base type does not appear in the identifier used to reference the base type does not appear in the
expansion. Therefore, the @scheme[define-struct] transformer adds the expansion. Therefore, the @scheme[define-struct] transformer adds the
identifier to the expansion result as a @scheme['disappeared-use] identifier to the expansion result as a
property.} @indexed-scheme['disappeared-use] property.}
@item{When a reference to an unexported or protected identifier from @item{When a reference to an unexported or protected identifier from
a module is discovered (and the reference is certified; see a module is discovered (and the reference is certified; see
@secref["mz:stxcerts"]), the @scheme['protected] property is added @secref["mz:stxcerts"]), the @indexed-scheme['protected] property is
to the identifier with a @scheme[#t] value.} added to the identifier with a @scheme[#t] value.}
@item{When or @scheme[read-syntax] or @scheme[read-honu-syntax] @item{When or @scheme[read-syntax] or @scheme[read-honu-syntax]
generates a syntax object, it attaches a property to the object generates a syntax object, it attaches a property to the object

View File

@ -20,9 +20,9 @@ arguments for the program. Under Unix and Mac OS X, command-line
arguments are passed as byte strings using the current locale's arguments are passed as byte strings using the current locale's
encoding (see @secref["mz:encodings"]). encoding (see @secref["mz:encodings"]).
Under Windows, the first @scheme[arg] can be @scheme['exact], which Under Windows, the first @scheme[arg] can be @indexed-scheme['exact],
triggers a Windows-specific hack: the second @scheme[arg] is used which triggers a Windows-specific hack: the second @scheme[arg] is
exactly as the command-line for the subprocess, and no additional used exactly as the command-line for the subprocess, and no additional
@scheme[arg]s can be supplied. Otherwise, a command-line string is @scheme[arg]s can be supplied. Otherwise, a command-line string is
constructed from @scheme[command] and @scheme[arg] so that a typical constructed from @scheme[command] and @scheme[arg] so that a typical
Windows console application can parse it back to an array of Windows console application can parse it back to an array of
@ -43,7 +43,7 @@ pipe is created and the corresponding returned value is @scheme[#f].
The @scheme[subprocess] procedure returns four values: The @scheme[subprocess] procedure returns four values:
\begin{itemize} @itemize{
@item{a subprocess value representing the created process;} @item{a subprocess value representing the created process;}
@ -67,7 +67,8 @@ The returned ports are @tech{file-stream ports} (see
the current custodian (see @secref["mz:custodians"]). The the current custodian (see @secref["mz:custodians"]). The
@exnraise[exn:fail] when a low-level error prevents the spawning of a @exnraise[exn:fail] when a low-level error prevents the spawning of a
process or the creation of operating system pipes for process process or the creation of operating system pipes for process
communication. communication.}
@defproc[(subprocess-wait [subproc subprocess?]) void?]{ @defproc[(subprocess-wait [subproc subprocess?]) void?]{
@ -78,10 +79,11 @@ Blocks until the process represented by @scheme[subproc] terminates.}
(or/c (one-of/c 'running) (or/c (one-of/c 'running)
nonnegative-exact-integer?)]{ nonnegative-exact-integer?)]{
Returns @scheme['running] if the process represented by @scheme[subproc] is still running, or its exit Returns @indexed-scheme['running] if the process represented by
code otherwise. The exit code is an exact integer, and @scheme[0] @scheme[subproc] is still running, or its exit code otherwise. The
typically indicates success. If the process terminated due to a fault exit code is an exact integer, and @scheme[0] typically indicates
or signal, the exit code is non-zero.} success. If the process terminated due to a fault or signal, the exit
code is non-zero.}
@defproc[(subprocess-kill [subproc subprocess?][force? any/c]) void?]{ @defproc[(subprocess-kill [subproc subprocess?][force? any/c]) void?]{
@ -113,9 +115,9 @@ otherwise.}
[target string?][parameters string?][dir path-string?][show-mode symbol?]) [target string?][parameters string?][dir path-string?][show-mode symbol?])
false/c] false/c]
@index['("ShellExecute")]{Performs} the action specified by @index['("ShellExecute")]{Performs} the action specified by @scheme[verb]
@scheme[verb] on @scheme[target] in Windows. For platforms other than on @scheme[target] in Windows. For platforms other than Windows, the
Windows, the @exnraise[exn:fail:unsupported]. @exnraise[exn:fail:unsupported].
For example, For example,
@ -149,46 +151,52 @@ of each symbol's meaning is taken from the Windows API documentation.
@itemize{ @itemize{
@item{@scheme['sw_hide] or @scheme['SW_HIDE] --- Hides the window and @item{@indexed-scheme['sw_hide] or @indexed-scheme['SW_HIDE] ---
activates another window.} Hides the window and activates another window.}
@item{@scheme['sw_maximize] or @scheme['SW_MAXIMIZE] --- Maximizes @item{@indexed-scheme['sw_maximize] or @indexed-scheme['SW_MAXIMIZE]
the window.} --- Maximizes the window.}
@item{@scheme['sw_minimize] or @scheme['SW_MINIMIZE] --- Minimizes @item{@indexed-scheme['sw_minimize] or @indexed-scheme['SW_MINIMIZE]
the window and activates the next top-level window in the z-order.} --- Minimizes the window and activates the next top-level window in
the z-order.}
@item{@scheme['sw_restore] or @scheme['SW_RESTORE] --- Activates and @item{@indexed-scheme['sw_restore] or @indexed-scheme['SW_RESTORE]
displays the window. If the window is minimized or maximized, Windows --- Activates and displays the window. If the window is minimized or
restores it to its original size and position.}
@item{@scheme['sw_show] or @scheme['SW_SHOW] --- Activates the window
and displays it in its current size and position.}
@item{@scheme['sw_showdefault] or @scheme['SW_SHOWDEFAULT] --- Uses a
default.}
@item{@scheme['sw_showmaximized] or @scheme['SW_SHOWMAXIMIZED] ---
Activates the window and displays it as a maximized window.}
@item{@scheme['sw_showminimized] or @scheme['SW_SHOWMINIMIZED] ---
Activates the window and displays it as a minimized window.}
@item{@scheme['sw_showminnoactive] or @scheme['SW_SHOWMINNOACTIVE]
--- Displays the window as a minimized window. The active window
remains active.}
@item{@scheme['sw_showna] or @scheme['SW_SHOWNA] --- Displays the
window in its current state. The active window remains active.}
@item{@scheme['sw_shownoactivate] or @scheme['SW_SHOWNOACTIVATE] ---
Displays a window in its most recent size and position. The active
window remains active.}
@item{@scheme['sw_shownormal] or @scheme['SW_SHOWNORMAL] ---
Activates and displays a window. If the window is minimized or
maximized, Windows restores it to its original size and position.} maximized, Windows restores it to its original size and position.}
@item{@indexed-scheme['sw_show] or @indexed-scheme['SW_SHOW] ---
Activates the window and displays it in its current size and
position.}
@item{@indexed-scheme['sw_showdefault] or
@indexed-scheme['SW_SHOWDEFAULT] --- Uses a default.}
@item{@indexed-scheme['sw_showmaximized] or
@indexed-scheme['SW_SHOWMAXIMIZED] --- Activates the window and
displays it as a maximized window.}
@item{@indexed-scheme['sw_showminimized] or
@indexed-scheme['SW_SHOWMINIMIZED] --- Activates the window and
displays it as a minimized window.}
@item{@indexed-scheme['sw_showminnoactive] or
@indexed-scheme['SW_SHOWMINNOACTIVE] --- Displays the window as a
minimized window. The active window remains active.}
@item{@indexed-scheme['sw_showna] or @indexed-scheme['SW_SHOWNA] ---
Displays the window in its current state. The active window remains
active.}
@item{@indexed-scheme['sw_shownoactivate] or
@indexed-scheme['SW_SHOWNOACTIVATE] --- Displays a window in its most
recent size and position. The active window remains active.}
@item{@indexed-scheme['sw_shownormal] or
@indexed-scheme['SW_SHOWNORMAL] --- Activates and displays a
window. If the window is minimized or maximized, Windows restores it
to its original size and position.}
} }
If the action fails, the @exnraise[exn:fail]. If the action succeeds, If the action fails, the @exnraise[exn:fail]. If the action succeeds,

View File

@ -781,10 +781,10 @@ an expression take precedence. For example, in
the procedure bound to @scheme[my-f] will have the inferred name the procedure bound to @scheme[my-f] will have the inferred name
@scheme['f]. @scheme['f].
When an @scheme['inferred-name] property is attached to a syntax When an @indexed-scheme['inferred-name] property is attached to a
object for an expression (see @secref["mz:stxprops"]), the property syntax object for an expression (see @secref["mz:stxprops"]), the
value is used for naming the expression, and it overrides any name property value is used for naming the expression, and it overrides any
that was inferred from the expression's context. name that was inferred from the expression's context.
When an inferred name is not available, but a source location is When an inferred name is not available, but a source location is
available, a name is constructed using the source location available, a name is constructed using the source location

View File

@ -147,6 +147,8 @@ The result is useful only to low-level extensions; see
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "mz:application"]{Procedure Applications and @scheme[#%app]} @section[#:tag "mz:application"]{Procedure Applications and @scheme[#%app]}
@section-index{evaluation order}
@guideintro["guide:application"]{procedure applications} @guideintro["guide:application"]{procedure applications}
@defform/none[(proc-expr arg ...)]{ @defform/none[(proc-expr arg ...)]{
@ -325,10 +327,10 @@ the procedure body.
]} ]}
When compiling a @scheme[lambda] or @scheme[case-lambda] expression, When compiling a @scheme[lambda] or @scheme[case-lambda] expression,
Scheme looks for a @scheme['method-arity-error] property attached to Scheme looks for a @indexed-scheme['method-arity-error] property
the expression (see @secref["mz:stxprops"]). If it is present with a attached to the expression (see @secref["mz:stxprops"]). If it is
true value, and if no case of the procedure accepts zero arguments, present with a true value, and if no case of the procedure accepts
then the procedure is marked so that an zero arguments, then the procedure is marked so that an
@scheme[exn:fail:contract:arity] exception involving the procedure @scheme[exn:fail:contract:arity] exception involving the procedure
will hide the first argument, if one was provided. (Hiding the first will hide the first argument, if one was provided. (Hiding the first
argument is useful when the procedure implements a method, where the argument is useful when the procedure implements a method, where the
@ -1005,6 +1007,12 @@ multiple @scheme[form]s are provided, they are wrapped with
@schemeidfont{#%module-begin}, as in the case where a single @schemeidfont{#%module-begin}, as in the case where a single
@scheme[form] does not expand to @scheme[#%module-begin]. @scheme[form] does not expand to @scheme[#%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
@secref["mz:stxprops"]); the property's value is a symbol
corresponding to @scheme[id].
Each @scheme[form] is partially expanded (see Each @scheme[form] is partially expanded (see
@secref["mz:partial-expansion"]) in a @tech{module context}. Further @secref["mz:partial-expansion"]) in a @tech{module context}. Further
action depends on the shape of the form: action depends on the shape of the form:
@ -1078,6 +1086,8 @@ Legal only in a @tech{module begin context}, and handled by the
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "mz:require"]{Importing: @scheme[require], @scheme[require-for-syntax], @scheme[require-for-template]} @section[#:tag "mz:require"]{Importing: @scheme[require], @scheme[require-for-syntax], @scheme[require-for-template]}
@section-index["modules" "imports"]
@defform/subs[#:literals (only only-rename prefix all-except prefix-all-except rename lib file planet) @defform/subs[#:literals (only only-rename prefix all-except prefix-all-except rename lib file planet)
(require require-spec ...) (require require-spec ...)
([require-spec module-path ([require-spec module-path
@ -1199,6 +1209,8 @@ and @secref["mz:mod-parse"]).
@;------------------------------------------------------------------------ @;------------------------------------------------------------------------
@section[#:tag "mz:provide"]{Exporting: @scheme[provide] and @scheme[provide-for-syntax]} @section[#:tag "mz:provide"]{Exporting: @scheme[provide] and @scheme[provide-for-syntax]}
@section-index["modules" "exports"]
@defform/subs[#:literals (protect all-defined all-from rename except prefix) @defform/subs[#:literals (protect all-defined all-from rename except prefix)
(provide protected-provide-spec ...) (provide protected-provide-spec ...)
([protected-provide-spec provide-spec ([protected-provide-spec provide-spec

View File

@ -2,7 +2,6 @@
@require[(lib "bnf.ss" "scribble")] @require[(lib "bnf.ss" "scribble")]
@require["mz.ss"] @require["mz.ss"]
@define[(fileFirst s) (index (list s) (file s))]
@define[MzAdd (italic "Scheme-specific:")] @define[MzAdd (italic "Scheme-specific:")]
@title[#:tag "mz:windowspaths"]{Windows Path Conventions} @title[#:tag "mz:windowspaths"]{Windows Path Conventions}
@ -65,14 +64,14 @@ include @litchar["\\"].
@item{The following special ``files'', which access devices, exist in @item{The following special ``files'', which access devices, exist in
all directories, case-insensitively, and with all possible all directories, case-insensitively, and with all possible
endings after a period or colon, except in pathnames that start endings after a period or colon, except in pathnames that start
with @litchar["\\\\?\\"]: @fileFirst{NUL}, @fileFirst{CON}, with @litchar["\\\\?\\"]: @indexed-file{NUL}, @indexed-file{CON},
@fileFirst{PRN}, @fileFirst{AUX}, @fileFirst{COM1}, @indexed-file{PRN}, @indexed-file{AUX}, @indexed-file{COM1},
@fileFirst{COM2}, @fileFirst{COM3}, @fileFirst{COM4}, @indexed-file{COM2}, @indexed-file{COM3}, @indexed-file{COM4},
@fileFirst{COM5}, @fileFirst{COM6}, @fileFirst{COM7}, @indexed-file{COM5}, @indexed-file{COM6}, @indexed-file{COM7},
@fileFirst{COM8}, @fileFirst{COM9}, @fileFirst{LPT1}, @indexed-file{COM8}, @indexed-file{COM9}, @indexed-file{LPT1},
@fileFirst{LPT2}, @fileFirst{LPT3}, @fileFirst{LPT4}, @indexed-file{LPT2}, @indexed-file{LPT3}, @indexed-file{LPT4},
@fileFirst{LPT5}, @fileFirst{LPT6}, @fileFirst{LPT7}, @indexed-file{LPT5}, @indexed-file{LPT6}, @indexed-file{LPT7},
@fileFirst{LPT8}, @fileFirst{LPT9}.} @indexed-file{LPT8}, @indexed-file{LPT9}.}
@item{Except for @litchar["\\\\?\\"] paths, @litchar{/}s are @item{Except for @litchar["\\\\?\\"] paths, @litchar{/}s are
equivalent to @litchar["\\"]s. Except for @litchar["\\\\?\\"] equivalent to @litchar["\\"]s. Except for @litchar["\\\\?\\"]