This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Problem with macro expansion
- From: Colin Fleming <colin dot mailinglist at gmail dot com>
- To: kawa at sourceware dot org
- Date: Wed, 25 Nov 2009 12:38:37 +0100
- Subject: Problem with macro expansion
- References: <7c6512110911250335p42fc48c4qb89630793064af0c@mail.gmail.com>
Hi all,
I'm just getting started with Kawa (and Scheme, really), so forgive me
if this is a basic question. I'm trying to use Kawa to write a plugin
for a Java app in Scheme. I have the following:
(module-name "scheme.Tokens")
(module-static #t)
(define-namespace IElement "class:com.intellij.psi.tree.IElementType")
(define-namespace Element
"class:org.jetbrains.plugins.scheme.parser.SchemeElementType")
(define-constant open-vector :: IElement (Element:new "#("))
(token open-vector "#(")
(define-syntax token
? (syntax-rules () ((_ name desc)
??????????????????? (define-constant name :: IElement (Element:new desc)))))
The (define-constant open-vector :: IElement (Element:new "#(")) is
what I'd like to make a macro out of, which should result in being
able to use the form (token open-vector "#(").
In the REPL this works, but when I try to compile the class, I get the error:
(compiling Tokens.scm to scheme.Tokens)
Tokens.scm:9:1: define-constant is only allowed in a <body>
Where 9:1 is the line of the macro invocation. Am I missing something
obvious here? This is with Kawa 1.9.90.
Thanks,
Colin