diff --git a/collects/scribblings/guide/pattern-macros.scrbl b/collects/scribblings/guide/pattern-macros.scrbl index 4a967768fc..877b7fc3df 100644 --- a/collects/scribblings/guide/pattern-macros.scrbl +++ b/collects/scribblings/guide/pattern-macros.scrbl @@ -3,6 +3,8 @@ scribble/eval "guide-utils.ss") +@(define swap-eval (make-base-eval)) + @title[#:tag "pattern-macros"]{Pattern-Based Macros} A @deftech{pattern-based macro} replaces any code that matches a @@ -247,9 +249,9 @@ Given our macro definitions, the @racket[swap] or @racket[rotate] identifiers must be used after an open parenthesis, otherwise a syntax error is reported: -@interaction-eval[(define-syntax swap (syntax-rules ()))] +@interaction-eval[#:eval swap-eval (define-syntax swap (syntax-rules ()))] -@interaction[(+ swap 3)] +@interaction[#:eval swap-eval (+ swap 3)] An @deftech{identifier macro} works in any expression. For example, we can define @racket[clock] as an identifier macro that expands to @@ -481,3 +483,6 @@ Racket with just three small pattern-based macros: @racket[define-cbr], @racket[define-for-cbr], and @racket[define-get/put-id]. +@; ----------------------------------------------------------------- + +@close-eval[swap-eval]