Re: A Hygenic Macrology Question
- From: drcode@xxxxxxxxx
- Date: 28 Jan 2006 12:02:46 -0800
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...
.
- Follow-Ups:
- Re: A Hygenic Macrology Question
- From: Jens Axel Søgaard
- Re: A Hygenic Macrology Question
- References:
- A Hygenic Macrology Question
- From: drcode
- Re: A Hygenic Macrology Question
- From: Jens Axel Søgaard
- A Hygenic Macrology Question
- Prev by Date: Re: How to destroy a system
- Next by Date: Re: A Hygenic Macrology Question
- Previous by thread: Re: A Hygenic Macrology Question
- Next by thread: Re: A Hygenic Macrology Question
- Index(es):