Re: A Hygenic Macrology Question



Thanks Jens- I thought of doing that, except now the expression is no
longer equivalent to "let" because of the altered variable scoping- I
should have indicated that I want to maintain an identical variable
scoping :)

To Illustrate:

(define-syntax (conrad--> stx)
(syntax-case stx ()
((conrad--> z) (syntax z))
((conrad--> x0 y0 z) (syntax (let ((x0 y0))
z)))
((conrad--> x0 y0 x1 y1 z) (syntax (let ((x0 y0) (x1 y1))
z)))))

(define-syntax (jens--> stx)
(syntax-case stx ()
((jens--> z) (syntax z))
((jens--> x0 y0 . more) (syntax (let ((x0 y0))
(jens--> . more ))))))

(let ((x 4))
(let ((x 3)
(y (+ 10 x)))
(+ x y)))

(let ((x 4))
(conrad--> x 3
y (+ 10 x)
(+ x y)))

(let ((x 4))
(jens--> x 3
y (+ 10 x)
(+ x y)))

The last the expressions return 17, 17, and 16 respectively...
I'm sure there's a way to overcome this limitation, but I can't figure
it out...

.