From 2133e59ccfadc90829ea63f08f2192fe4a14e352 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 19 Jun 2007 00:23:11 +0000 Subject: [PATCH] doc work: set! in guide svn: r6690 original commit: e2dfc97726ae06937b0edeb63ac7e56e05be5866 --- collects/scribble/eval.ss | 33 ++++++++++++++++++++++++++------- collects/scribble/scheme.ss | 14 +++++++------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/collects/scribble/eval.ss b/collects/scribble/eval.ss index db4105e3..a31d011e 100644 --- a/collects/scribble/eval.ss +++ b/collects/scribble/eval.ss @@ -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))))))]))) diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss index 34cfa4a2..d2dcdc23 100644 --- a/collects/scribble/scheme.ss +++ b/collects/scribble/scheme.ss @@ -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