Re: Unwrapping Java Character to char
Robert Dodier <[email protected]> Thu, 4 Jan 2024 11:16:31 -0800
| Newsgroups | gmane.editors.j.devel |
|---|---|
| Message-ID | <CAAsY_sRWkYPzFx28U7g3rM6u-4p44CrEPLKayxTVGwnYY+J0mA__14276.1188720883$1704395857$gmane$org@mail.gmail.com> |
On Thu, Jan 4, 2024 at 3:11=E2=80=AFAM Mark Evenson <[email protected]> wro= te: > or 2) just programmatically call the org.armedbear.lisp.LispCharacter > constructor to get a Lisp character? > For 2) why can=E2=80=99t you use CODE-CHAR Right, I want to call the LispCharacter constructor. CODE-CHAR yields a java.lang.Character, as reported by (java:jcall "getClass" (code-char #xnnnn)), so that's not quite enough. To back up a little, what I really want is for ABCL to recognize Unicode characters by name, e.g. #\BOX_DRAWINGS_LIGHT_VERTICAL and so on. Towards that end, I believe, perhaps unreasonably, that if I can wedge a new item into LispCharacter.lispChars, then I can call LispCharacter.setCharName, and then -- presto, perhaps -- the reader will recognize #\MY_NEW_NAME. Then, of course, I'll be able to compile some new code which makes use of those named characters without modifying that code. Some other Lisp implementations recognize those out of the box; at least one needs to have them defined, for which there is an internal Lisp function to do it. It appears it's also possible with ABCL with a little more effort. Thanks for your help, and all the best. Robert