[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Control characters in # macro.
- To: ALAN at MIT-AI, CWH at MIT-MC, MOON at MIT-MC, GLS at MIT-MC, KMP at MIT-MC, NIL at MIT-MC, BUG-LISP at MIT-MC
- Subject: Control characters in # macro.
- From: Alan Bawden <ALAN at MIT-AI>
- Date: Tue, 11 Sep 79 21:40:00 GMT
- Original-date: 11 September 1979 17:40-EDT
Date: 11 September 1979 10:16-EDT
From: Carl W. Hoffman <CWH at MIT-MC>
The idea of a character called Control-C is the same when typed on the Lisp
Machine as when typed on an ascii keyboard.
There are two ways of typing a Control-C from a Knight keyboard to MacLisp: You can
hold down CTRL and type C, or you can hold down TOP and type X. The two cases are the
same for a keyboard open in the vanilla way. If you hack 12 bit input however, you
get extra high-order bits telling you just how the character was typed.
I simply want ONE way of
writing this object.
The problem is it isn't ONE object!
There's no reason why a piece of code which does
(= (TYI) #/C) can't work on both the Lisp Machine and in TOPS-20 MacLisp.
OK lets think it through. Lets try and figure out what fixnum #/C should be. Since
the tty is normally open in a vanilla way it can't return a number greater than 177, so
the only reasonable choice is for #/C to read in as 3. (presumably #/C errs out
in some reasonable way.) Now suppose the tty was open in 12 bit mode how are we to
generate the 12 bit character code? #/C can't read the users mind (or his code).
The problem which Alan tries to solve with his #^ hack is the fact that two
character sets are available in ITS MacLisp. #/C can read as two different
things -- Control-C as represented in ascii or as represented in the ITS
12-bit character set. This could be controlled by a read-time switch.
OK so instead of reading my mind I have to tell the reader what I am thinking,
This isn't to bad (I have to tell it what base I have in mind too!)
Anyone
hacking both character sets would presumably canonicalize to a single form.
If you are hacking both "character sets" you have to have #/C generate the 12 bit code.
This is why this should be the default meaning for #/C. (In the other mode
you are going to have to deal with the meaning of #/c and #/C somehow!)
The point of #^C is for hacking the strict ASCII character set in a mnemonic way.
It is only for MacLisp because only maclisp has this restriction. It is still true
that #/ (which reads the same) looks funny on some terminals. So if we try and create
a # macro that MacLisp users can use (even when they are not writing compatable code)
It should have this ability.