This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Problem with compiled macro
- From: "Are Meisfjord" <are at meisfjord dot com>
- To: kawa at sources dot redhat dot com
- Date: Wed, 18 Dec 2002 16:28:07 +0100
- Subject: Problem with compiled macro
Hello!
I have a problem with compiled macros. The problem seems to occur
only in some situations when the macro expands to a function
definition using #!key, #!rest or #!optional arguments. Example:
;;; begin test.scm
(defmacro defmaker (name . args)
`(define (,name #!key ,@args) (list ,@args)))
;;; end test.scm
C:\>java kawa.repl --module-static -C test.scm
(compiling test.scm)
C:\>java kawa.repl
#|kawa:1|# (load "test.class")
java.lang.VerifyError: (class: test, method: <clinit> signature: ()V)
Bad type in putfield/putstatic
at java.lang.Class.forName0(Native Method)
...
I don't think there is anything wrong with the macro itself - it
works when it's loaded from the source rather than the compiled file:
#|kawa:2|# (load 'test.scm)
#|kawa:3|# (defmaker foo a b c)
#|kawa:4|# (foo)
(#f #f #f)
#|kawa:5|# (foo :b 1)
(#f 1 #f)
The problem disappears when '#!key' is removed from the macro
definition. But then of course the macro does not work the way I
wanted. Any comments?
Regards,
Are