[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Macro using procedure
From: |
Daniel Sadilek |
Subject: |
[Chicken-users] Macro using procedure |
Date: |
Fri, 9 Mar 2007 14:29:37 +0100 |
Hello,
I want to write a macro that uses a help procedure. The following code
does not compile but in the interpreter it works and prints out "hi".
---------------------
(use syntax-case)
(define (macrohelper param)
param)
(define-syntax testsyntax
(lambda (x)
(syntax-case x ()
((_ foo)
(with-syntax ((bar (macrohelper (syntax foo))))
(syntax (display 'bar)))))))
(testsyntax hi)
(newline)
---------------------
The faq explains that during compilation "macrohelper" is not visible
but does not provide a solution :(
In the mailing list archive I found the suggestion to use eval-when
but that didn't work either.
(I changed the definition of macrohelper to:
---------------------
(eval-when (compile eval)
(define (macrohelper param)
param))
---------------------
)
Best regards
Daniel Sadilek
- [Chicken-users] Macro using procedure,
Daniel Sadilek <=