Subject: Re: bug#6080: Behaviour of `char-syntax' changes when byte-compiled

From: Stefan Monnier <[email-masked]>
Date: Mon, 03 May 2010 13:05:40 -0400

>   (defun test ()
>     (let ((char 33554464))
>       (message "char: %s" char)
>       (message "syntax: %s" (char-syntax char)))
>     nil)

> (Note that 33554464 is the value of `last-input-event' when a command is
> invoked by the key sequence "S-<SPC>".)

> When the test function is evalled and then run with "M-: (test)", it
> outputs the following in the *Messages* buffer:

> char: 33554464
> syntax: 32
> nil

That's an error: S-SPC is not a char, so the function should signal
an error.

> When the test function is byte-compiled, loaded, and run as before with
> "M-: (test)", it throws an error and produces the following backtrace:

Yes, oddly enough (it probably made sense at some point, of course, but
that point was passed a very long time ago), char-syntax has its own
byte code, so what happens above is that the byte-code version of
char-syntax is not implemented in the exact same way as
char-syntax function.

        Stefan