This is the mail archive of the 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]

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,

#|kawa:4|# (define gf (primitive-static-method <java.awt.Font> "getFont" <Font> (<String>)))
#|kawa:5|# gf
#<primitive procedure Font java.awt.Font.getFont(java.lang.String)>
#|kawa:6|#  (gf "Helvetica")
#|kawa:7|# (define f (gf "Helvetica"))
#|kawa:8|# f
gnu.mapping.UnboundSymbol: Unbound symbol f
        at java.lang.Throwable.fillInStackTrace(Native Method)
        at java.lang.Throwable.fillInStackTrace(Compiled Code)
        at java.lang.Throwable.<init>(Compiled Code)
        at java.lang.Exception.<init>(
        at java.lang.RuntimeException.<init>(
        at gnu.mapping.UnboundSymbol.<init>(
        at gnu.expr.ReferenceExp.lookup(
        at gnu.expr.ReferenceExp.eval(
        at gnu.expr.ModuleExp.evalModule(Compiled Code)
        at Code)
        at kawa.repl.main(Compiled Code)

I would like to be able to keep the returned value in a Scheme
variable and pass it to a Java method later.