This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: bug when compiling macro
- To: ygrats at gmx dot net
- Subject: Re: bug when compiling macro
- From: Per Bothner <per at bothner dot com>
- Date: 06 Aug 2000 19:30:04 -0700
- Cc: kawa at sourceware dot cygnus dot com
- References: <5843.965378534@www8.gmx.net>
ygrats@gmx.net writes:
> if I compile the following file (let's say bla.scm):
>
> (module-name "bla")
> (module-static #t)
>
> (define-syntax jhash-get
> (syntax-rules ()
> ((jhash-get hash key)
> (let ((val (invoke (as <java.util.Hashtable> hash) 'get key)))
> (if (eq? val #!null)
> #f
> val)))))
>
> by 'kawa -d . -C bla.scm
> I get a <unknown>:0: Literals: Internal
> error:java.lang.NullPointerException.
>
> Any ideas about that?
The following patch (which I have checked into cvs) shodl fix that:
Index: LitTable.java
===================================================================
RCS file: /cvs/kawa/kawa/gnu/expr/LitTable.java,v
retrieving revision 1.2
diff -u -r1.2 LitTable.java
--- LitTable.java 2000/06/11 02:00:18 1.2
+++ LitTable.java 2000/08/07 02:19:38
@@ -183,7 +183,8 @@
writeObject(arr[i]);
}
}
- else if (obj instanceof String || lit.type instanceof ArrayType)
+ else if (obj == null
+ || obj instanceof String || lit.type instanceof ArrayType)
{
// nothing to do
}
> BTW, can I export syntax-definitions, or is this not necessary?
Yes and yes.
I.e. if you compile bla.scm, then you can (require <bla>), and then
use jhash-get.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/