From cc998b9fe1305f4e0ad8d2df5bf0b0d800d6ab02 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 22 Jul 2012 13:38:26 -0400 Subject: [PATCH] Use a new evaluaor in "for.scrbl", have it require `racket/base' for syntax. Also explicitly close the evaluator used in "block.scrbl". Closes PR 12931. (cherry picked from commit 476c270a66c594d1da8d778f299b2aa0fd682015) --- collects/scribblings/reference/block.scrbl | 1 + collects/scribblings/reference/for.scrbl | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/collects/scribblings/reference/block.scrbl b/collects/scribblings/reference/block.scrbl index 7dacbf16a2..61a3aad2ad 100644 --- a/collects/scribblings/reference/block.scrbl +++ b/collects/scribblings/reference/block.scrbl @@ -33,3 +33,4 @@ an expression. (f 12) ]} +@close-eval[ev] diff --git a/collects/scribblings/reference/for.scrbl b/collects/scribblings/reference/for.scrbl index 1df1941944..87f64fbba8 100644 --- a/collects/scribblings/reference/for.scrbl +++ b/collects/scribblings/reference/for.scrbl @@ -5,10 +5,12 @@ @guideintro["for"]{iterations and comprehensions} +@(define for-eval (make-base-eval)) +@(for-eval '(require (for-syntax racket/base))) + The @racket[for] iteration forms are based on SRFI-42 @cite["SRFI-42"]. - @section{Iteration and Comprehension Forms} @defform/subs[(for (for-clause ...) body ...+) @@ -284,9 +286,11 @@ Like @racket[for/list], etc., but with the implicit nesting of @defform[(for/fold/derived orig-datum ([accum-id init-expr] ...) (for-clause ...) body ...+)]{ -Like @racket[for/fold], but the extra @racket[orig-datum] is used as the source for all syntax errors. -@mz-examples[ +Like @racket[for/fold], but the extra @racket[orig-datum] is used as the +source for all syntax errors. + +@mz-examples[#:eval for-eval (define-syntax (for/digits stx) (syntax-case stx () [(_ clauses . defs+exprs) @@ -314,7 +318,7 @@ Like @racket[for/fold], but the extra @racket[orig-datum] is used as the source ([accum-id init-expr] ...) (for-clause ...) body ...+)]{ Like @racket[for*/fold], but the extra @racket[orig-datum] is used as the source for all syntax errors. -@mz-examples[ +@mz-examples[#:eval for-eval (define-syntax (for*/digits stx) (syntax-case stx () [(_ clauses . defs+exprs) @@ -373,7 +377,7 @@ use @racket[:do-in]. To protect identifiers in the result of @racket[clause-transform-expr], use @racket[for-clause-syntax-protect] instead of @racket[syntax-protect]. -@mz-examples[ +@mz-examples[#:eval for-eval (define-sequence-syntax in-digits (lambda () #'in-digits/proc) (lambda (stx) @@ -482,3 +486,5 @@ When @racket[stop?-expr] produces a true value, then the evaluated in tail position to produce the overall value for the @racket[do] form. If no @racket[finish-expr] is provided, the value of the @racket[do] form is @|void-const|.} + +@close-eval[for-eval]