I am attempting to write a macro to clean up the use of define-values/invoke-unit and finding some confusing behavior.
My macros module is: #lang racket (provide (all-defined-out)) (define-signature dog^ (woof bark)) (define mutt@ (unit (import) (export dog^) (define (woof) (printf "Wuf !!\n")) (define (bark) (printf "RarRarRar !!\n")))) (define-syntax use-dog (syntax-rules () ([_ dog-unit] (define-values/invoke-unit dog-unit (import) (export dog^))))) ..and the module using it is: #lang racket (require "macros.rkt") (define-values/invoke-unit mutt@ (import) (export dog^)) (use-dog mutt@) (woof) (woof) (bark) (woof) I am trying to make the "use-dog" macro expand to the equivalent define-values/invoke-unit form as shown. If I comment out the define-value/invoke-unit form I get warning about unbound identifier woof - implying that the (use-dog dog^) form is not doing the job. Moreover, the second module as it stands does not give a warning about duplicate definitions for woof or bark (as it does if I duplicate the define-values/invoke-unit form) - further indicating the non-action of use-dog. The macro stepper shows use-dog expand exactly as expected, but it then seems to be ignored without any warnings. Is there something I am misunderstanding here, or is this a bug ?
____________________ Racket Users list: http://lists.racket-lang.org/users