This is the mail archive of the kawa@sourceware.cygnus.com mailing list for the Kawa project. See the Kawa home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: return types of Java methods



> What happens if I call a Java method that returns an object of type
> not convertible to a Scheme type? For example,

All objects are Scheme types.
The problem in your example is with #!null - which is not an object.
(It is Java null.)  Kawa is not fully null-safe.  Specifically,
global environments do not distinguish between a symbol bound
to #!null and an unbound symbol.  This is a bug.  (However, it is
not a bug wrt Scheme conformance, of course, since no portable
Scheme code can generate #!null - I hope.)

A work-around is to wrap the #!null in a list:

#|kawa:10|# (define f (list  (gf "Helvetica")))
#|kawa:11|# f
(#!null)
#|kawa:12|# (car f)
#!null
#|kawa:13|#

	--Per Bothner
Cygnus Solutions     bothner@cygnus.com     http://www.cygnus.com/~bothner