This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with macro expansion


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]