Re: Associating names with characters for named Unicode characters
Alejandro, thanks a lot for your reply. Is there a way, in abcl-utils, to inform the Lisp reader to recognize named characters such as #\BOX_DRAWINGS_LIGHT_HORIZONTAL in source code? That is the ultimate goal I am seeking. best, Robert
You are welcome :) No, sorry it is a small library, there only a few functions for unicode conversions mainly But you could do something with the Java internals For example: CL-USER> (jstatic "codePointOf" "java.lang.Character" "BOX DRAWINGS LIGHT HORIZONTAL") 9472 CL-USER> (code-char *) #\─ CL-USER> ... and maybe create a reader macro on top of this Best, Alejandro El mié, 3 ene 2024 a las 17:31, Robert Dodier (<robert.dodier@gmail.com>) escribió:
Alejandro, thanks a lot for your reply.
Is there a way, in abcl-utils, to inform the Lisp reader to recognize named characters such as #\BOX_DRAWINGS_LIGHT_HORIZONTAL in source code? That is the ultimate goal I am seeking.
best,
Robert
Now this is rudimentary but it works Probably with more time can be improved ABCL-UTILS> (defun unicode-converter (stream char) (declare (ignore char)) (code-char (abcl-utils:name->codepoint (symbol-name (read stream t nil t))))) UNICODE-CONVERTER ABCL-UTILS> (set-macro-character #\? #'unicode-converter) T ABCL-UTILS> ?:|BOX DRAWINGS LIGHT HORIZONTAL| #\─ ABCL-UTILS> El mié, 3 ene 2024 a las 17:31, Robert Dodier (<robert.dodier@gmail.com>) escribió:
Alejandro, thanks a lot for your reply.
Is there a way, in abcl-utils, to inform the Lisp reader to recognize named characters such as #\BOX_DRAWINGS_LIGHT_HORIZONTAL in source code? That is the ultimate goal I am seeking.
best,
Robert
participants (2)
-
Alejandro Zamora Fonseca
-
Robert Dodier