medley
medley copied to clipboard
The term "meta" is used to describe 2 different value ranges of character codes
Describe the bug In the IRM section 2.5:
- "meta" is used to describe characters with the # prefix. These characters have the 8th bit (=128) of the character code. E.g.,
#A
. - The forms
CHARSET,CHARNUM
andCHARSET-CHARNUM
put the value of theCHARSET
from theCHARACTERSETNAMES
alist into the high order byte of the character code as returned from theCHARCODE
function (implemented inCHARCODE.DECODE
in sources/LLREAD). E.g.,Meta,A
. "Meta" is a defined CHARSET name, with value 1.
Why setup/persist this obvious ambiguity in terminology?!
To Reproduce Steps to reproduce the behavior:
- In any sysout, in an Interlisp EXEC:
- Type: (LIST (CHARCODE "#A") (CHARCODE "Meta,A"))
- Returns: (193 321)
- Type: (READC)
- (for an IBM-type keyboard): hold down the left Alt key (the "Meta" key) then press the "," (comma) key, then release both
- This displays: # 1,44 (space inserted in comment after the # because of automatic issue reference)
- Press the Enter key to go back to the EXEC which returns the # 1,44 character. (like above)
- Type: (CHCON1 IT)
- Returns: 300
Expected behavior For step 3, I thought that both would return the same value. But I'm not sure which value I expected! For steps 6 and 9, I really wasn't sure which interpretation of "Meta" would be returned.
Additional context It seems that the resolution of this would be to change the term used to describe the # prefix in documentation.
Now a comment in CHARCODE.DECODE
in sources/LLREAD make sense.
Using the # prefix twice in succession would add 128 twice, and so would be adding 256 which is the same as a Meta,
prefix putting 1 into the high order byte.
This is actually what happens: (CHARCODE "##A")
returns 321. (So the implementation doesn't exactly match the documentation.)
I think that this was updated in release notes postdating the IRM - not sure if it was Koto, Lyric, or Medley. Also I remember there being an issue around #n,xxx
forms in Medley/Sun systems. Didn't @rmkaplan also make changes in this area within the last couple of years?