[plt-scheme] "compile time" action of macros
On 3/19/07, Chris Wright <chris.wright at southernhealth.org.au> wrote:
> Hi,
>
> I can achieve the desired effect (doing a calculation before run-time) with:
>
> (define-macro (bloop x)
> (let ((y (add1 x)))
> `(list ,y)))
>
> is there a way to do with with syntax-case? (I should, of course, ask
> "How do I do that with syntax case... :)
Untested:
(define-syntax (bloop stx)
(syntax-case stx ()
[(_ x) (let ([y (add1 (syntax-e #'x))])
#`(list #,y))]))
sam th
--
sam th
samth at ccs.neu.edu