commit e516be8dd41e2d49444725f12ff6edde81e33d14
parent 84d05633df68a0d3417bb042516f9a89fa6a56b2
Author: Matthew Flatt <mflatt@racket-lang.org>
Date: Thu, 22 May 2008 16:12:51 +0000
macros chapter in guide
svn: r9927
original commit: 6a93d0c531c75aba685ad31644317e4f8d819cfd
Diffstat:
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/collects/scribble/eval.ss b/collects/scribble/eval.ss
@@ -173,6 +173,7 @@
(cond
[(and v (hash-ref ht v #f))
=> (lambda (v) v)]
+ [(syntax? v) (make-literal-syntax v)]
[(string? v) (install ht v (string-copy v))]
[(bytes? v) (install ht v (bytes-copy v))]
[(pair? v)
diff --git a/collects/scribble/manual.ss b/collects/scribble/manual.ss
@@ -66,7 +66,7 @@
(list
(datum->syntax
#'filename
- `(code:comment (unsyntax (t "In \"" ,#'filename "\":")))
+ `(code:comment (unsyntax (t "In \"" ,(syntax-e #'filename) "\":")))
#'filename))
null)])
(syntax/loc stx (schemeblock file ... modtag rest ...)))]
diff --git a/collects/scribble/scheme.ss b/collects/scribble/scheme.ss
@@ -21,7 +21,8 @@
current-meta-list
(struct-out shaped-parens)
- (struct-out just-context))
+ (struct-out just-context)
+ (struct-out literal-syntax))
(define no-color "schemeplain")
(define reader-color "schemereader")
@@ -121,7 +122,9 @@
(memq (syntax-e c) (current-variable-list)))]
[(s it? sub?)
(let ([sc (syntax-e c)])
- (let ([s (format "~s" sc)])
+ (let ([s (format "~s" (if (literal-syntax? sc)
+ (literal-syntax-stx sc)
+ sc))])
(if (and (symbol? sc)
((string-length s) . > . 1)
(char=? (string-ref s 0) #\_)
@@ -654,6 +657,7 @@
(define-struct shaped-parens (val shape))
(define-struct just-context (val ctx))
+ (define-struct literal-syntax (stx))
(define-struct graph-reference (bx))
(define-struct graph-defn (r bx))