doc work: set! in guide

svn: r6690

original commit: e2dfc97726ae06937b0edeb63ac7e56e05be5866
This commit is contained in:
Matthew Flatt 2007-06-19 00:23:11 +00:00
parent 11e169f6c2
commit 2133e59ccf
2 changed files with 33 additions and 14 deletions

View File

@ -16,7 +16,9 @@
def+int
defs+int
examples
examples*
defexamples
defexamples*
as-examples
current-int-namespace
@ -35,7 +37,7 @@
(make-table
#f
(append
(if title (list (list title)) null)
(if title (list (list (make-flow (list title)))) null)
(let loop ([expr-paras expr-paras]
[val-list+outputs val-list+outputs]
[first? #t])
@ -270,19 +272,36 @@
(interaction e ...)))]))
(define example-title
(make-flow (list (make-paragraph (list "Examples:")))))
(make-paragraph (list "Examples:")))
(define-syntax examples
(syntax-rules ()
[(_ e ...)
(titled-interaction example-title schemeinput* e ...)]))
(define-syntax examples*
(syntax-rules ()
[(_ example-title e ...)
(titled-interaction example-title schemeinput* e ...)]))
(define-syntax defexamples
(syntax-rules ()
[(_ e ...)
(titled-interaction example-title schemedefinput* e ...)]))
(define-syntax defexamples*
(syntax-rules ()
[(_ example-title e ...)
(titled-interaction example-title schemedefinput* e ...)]))
(define (as-examples t)
(make-table #f
(list
(list example-title)
(list (make-flow (list t)))))))
(define (do-splice l)
(cond
[(null? l) null]
[(splice? (car l)) (append (splice-run (car l))
(do-splice (cdr l)))]
[else (cons (car l) (do-splice (cdr l)))]))
(define as-examples
(case-lambda
[(t) (as-examples example-title t)]
[(example-title t)
(make-table #f
(list
(list (make-flow (list example-title)))
(list (make-flow (do-splice (list t))))))])))

View File

@ -32,13 +32,13 @@
(define current-keyword-list
;; This is temporary, until the MzScheme manual is filled in...
(make-parameter '(define require provide
define-values begin0 when unless
new send if cond begin else => and or
define-syntax syntax-rules define-struct
quote quasiquote unquote unquote-splicing
syntax quasisyntax unsyntax unsyntax-splicing
set!)))
(make-parameter '(require
provide
new send else => and or
define-syntax syntax-rules define-struct
quote quasiquote unquote unquote-splicing
syntax quasisyntax unsyntax unsyntax-splicing
set! set!-values)))
(define current-variable-list
(make-parameter null))
(define current-meta-list