From b38bf09e4e56c0dad913278916d2b71a4429c09c Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 25 Jun 2012 23:25:58 -0600 Subject: [PATCH] HtDP language docs: fix context of defined bindings Uses the new `#:id' option in `defproc'. --- collects/lang/private/provide-and-scribble.rkt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/collects/lang/private/provide-and-scribble.rkt b/collects/lang/private/provide-and-scribble.rkt index 32705f3fdf..6da6d070bc 100644 --- a/collects/lang/private/provide-and-scribble.rkt +++ b/collects/lang/private/provide-and-scribble.rkt @@ -45,7 +45,11 @@ (define name* (syntax->list #'(name ...))) (values (cons (lambda () ;; delay the syntax creation until add-sections is set (with-syntax ([(ex ...) (extract-external-name name*)]) - #`(#,*add title (list (cons #'ex (defproc (ex args ...) range w ...)) ...)))) + #`(#,*add title (list (cons #'ex + (lambda (c) + (defproc #:id [ex (datum->syntax c 'ex)] + (ex args ...) range w ...))) + ...)))) add-docs-and-provide) (cons #`(provide #,@(optional-rename-out name*)) provides))]))) @@ -124,9 +128,8 @@ (cons @section[#:tag-prefix p]{@section-title} (cons typed others))])) - ;; this is not going to work (define (re-context c id defproc) - defproc) + (defproc c)) ;; (define (docs . exceptions)