[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plt-scheme] Macros and scope




Hello,

	I've encountered a Chezism that I'm not sure how to circumnavigate.

	(define-syntax letrec
	  (lambda (x)
            (import scheme)  ;;Right here.
	    (syntax-case x ()
	      [(_ ((var val) ...) body)
	      .... (syntax (foo (letrec ((var val) ...) body))) .... ])))

   In the Chez module system, you can "(import scheme)" when it becomes
convenient to lexically refresh the namespace with clean, top-level bindings.
In this case, this allows 'letrec' to be redefined to the outside world, but
within the scope of the binding lambda, 'letrec' takes on the default Chez
semantics.

	In short, I need to redefine 'letrec', but not within the scope of the
macro.

	Hints or suggestions appreciated. I'll keep at the manual re Mz's
modules, macro expansion, and namespaces.

	Thanks,
	Matt

________________________________________________________________________
Matt Jadud                            http://www.cs.indiana.edu/~mjadud/
Current Temperature Outside Lindley Hall                 55.6 F / 13.1 C
Canterbury Weather: High 57 F / 14 C, Low 46 F / 8 C, Sunny intervals