[honu] fix lexical context for require forms. fixup the module name to replace _ with -

This commit is contained in:
Jon Rafkind 2013-01-11 16:29:28 -07:00
parent 9a9b30c751
commit 81d58b1cb6

View File

@ -288,11 +288,15 @@
[pattern x:str #:with result #'x] [pattern x:str #:with result #'x]
[pattern (~seq x:not-comma ...) [pattern (~seq x:not-comma ...)
#:with result (with-syntax ([name #:with result (with-syntax ([name
;; use the lexical context of the original syntax
(datum->syntax (car (syntax->list #'(x.x ...)))
(string->symbol (string->symbol
(apply string-append (apply string-append
(map (compose symbol->string syntax->datum) (map (compose symbol->string syntax->datum)
(syntax->list #'(x.x ...)))))]) (syntax->list #'(x.x ...)))))
#'name)])) #'(x.x ...))
])
(fix-module-name #'name))]))
(provide honu-require) (provide honu-require)
(define-honu-syntax honu-require (define-honu-syntax honu-require