Re: Unwrapping Java Character to char

Robert Dodier <[email protected]> Wed, 3 Jan 2024 14:49:28 -0800
Newsgroups gmane.editors.j.devel
Message-ID <CAAsY_sRW=VHApVqoBD1TGMWVN4YaOtCD5WcPLAhRDwjerhJZQw__4392.99599254213$1704322229$gmane$org@mail.gmail.com>
Hi Blake, thanks for your reply.

I actually don't need to convert to ASCII -- what I really want to do
is to call a Java method which has a char argument. I got the
following error:

CL-USER(19): (jss:new "org.armedbear.lisp.LispCharacter" #\U2502)
#<THREAD "interpreter" native {41BFB5BC}>: Debugger invoked on
condition of type JAVA-EXCEPTION
  Java exception 'java.lang.NoSuchMethodException:
LispCharacter(java.lang.Character)'.

It appears that the Lisp character #\U2502 has been converted to a
Java Character, but that's not acceptable to the
org.armedbear.lisp.LispCharacter constructor, which is declared to
take a char argument; see line 70 of
src/org/armedbear/lisp/LispCharacter.java in the current version
(commit bba779e).

Now a complicating factor is that the LispCharacter(char) constructor
is declared private -- I don't know if that's the actual problem, and
the error message about the argument type is misleading. Are Java
private methods, variables, and constructors visible from Lisp?

All the best,

Robert