[armedbear-devel] One (probably) stupid question

Mark Evenson evenson at panix.com
Fri May 18 11:18:06 UTC 2012

On 5/18/12 13:14 , Francisco Vides Fernández wrote:

> How can I invoke a method with a boolean as an argument. I try to do the
> following:
> ---8<---
> (let* ((jlclass (jclass "java.lang.Class"))
>         (for-name (jmethod  jlclass "forName"
>                 (jclass "java.lang.String")
>                 (jclass "boolean")
>                 (jclass "java.lang.ClassLoader"))))
>    (jstatic for-name jlclass "org.postgresql.Driver" t
> (get-current-classloader)))
> ---8<---
> But it raises the error:
> The value T is not of class boolean
>     [Condition of type ERROR]
> I tried replacing '(jclass "boolean") for '(jclass "java.lang.Boolean"),
> but in that case it doesn't find the for-name method.
> How am I supposed to invoke the method!

Use the Java primitive for boolean truth bound to the constant 
JAVA:+TRUE+ instead of t.

Not a stupid question at all:  it should probably should go in our FAQ…

"A screaming comes across the sky.  It has happened before, but there
is nothing to compare to it now."

More information about the armedbear-devel mailing list