From 52047a04748d8d230e9d7d9e6a9339e9f0d7dec0 Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Thu, 17 May 2012 16:32:53 -0600 Subject: [PATCH] [honu] pass the original name being defined to get the proper lexical context --- collects/honu/core/private/macro2.rkt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/collects/honu/core/private/macro2.rkt b/collects/honu/core/private/macro2.rkt index 8b639a9aa0..d726cec8f6 100644 --- a/collects/honu/core/private/macro2.rkt +++ b/collects/honu/core/private/macro2.rkt @@ -232,7 +232,7 @@ (begin-for-syntax (define-syntax (create-honu-macro stx) (syntax-parse stx - [(_ (literal ...) (pattern ...) (action ...)) + [(_ name (literal ...) (pattern ...) (action ...)) (define pattern-variables (find-pattern-variables #'(pattern ...))) ;; only need a 1-to-1 mapping here @@ -285,15 +285,21 @@ (values (phase1:racket-syntax ;; trampoline to phase 1 (splicing-let-syntax ([make (lambda (stx) + #; + (create-honu-macro name + (literal ...) + (pattern ...) + (action ...)) (syntax-parse stx - [(_ name) + [(_ new-name) (define output - (create-honu-macro (literal ...) + (create-honu-macro name + (literal ...) (pattern ...) (action ...))) (debug "Output from create macro ~a\n" output) (with-syntax ([output output]) - #'(define-honu-syntax name output))]))]) + #'(define-honu-syntax new-name output))]))]) (make name))) #'rest #t)])))