[Openmcl-devel] Character Code Requests
gb at clozure.com
Tue Jan 30 10:38:53 UTC 2007
On Mon, 29 Jan 2007, Brent Fulgham wrote:
> I was wondering if the following additions could be made to the
> standard character registration functions in level-1/l1-reader.lisp:
> Request #1:
> Existing MCL refers to several character codes that are probably not
> valid on modern systems. Still, to make porting applications easier,
> it would be nice if the following character codes could be provided:
> ("BackArrow" . #\01C)
> ("ForwardArrow" . #\01D)
> ("UpArrow" . #\01E)
> ("DownArrow" . #\01F)
> This would at least avoid having to conditionalize these values using
> reader macros.
> Request #2:
> The new key codes in Cocoa event handlers are in a much higher range,
> so I would propose something along the lines of:
> (ccl::register-character-name "RightArrowFunctionKey" #
> (ccl::register-character-name "LeftArrowFunctionKey" #
> (ccl::register-character-name "UpArrowFunctionKey" #
> (ccl::register-character-name "DownArrowFunctionKey" #
> Unfortunately, even if I ignore the dire warnings of thread-unsafety
> and make use fo the REGISTER-CHARACTER-NAME function, I find that the
> CHAR-CODE and CODE-CHAR functions don't do what I would expect:
CCL::REGISTER-CHARACTER-NAME doesn't even bother to typecheck its
arguments. If it did, it would insist that its second argument
was a CHARACTER (not an integer which may happen to be a character
> ? #$NSRightArrowFunctionKey
> ? (char-code #\RightArrowFunctionKey)
> > Error: value 63235 is not of the expected type CHARACTER.
> > While executing: CHAR-CODE, in process Listener(4).
> > Type :POP to abort, :R for a list of available restarts.
> > Type :? for other options.
> > :pop
> ? (code-char 63235)
> Could we add the NS key-codes (at least for the cursor keys, and
> perhaps function keys) to those recognized by CODE-CHAR/CHAR-CODE?
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
More information about the Openmcl-devel