Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mimsy!eneevax!umd5!brl-adm!adm!rbbb@rice.EDU From: rbbb@rice.EDU (David Chase) Newsgroups: comp.lang.c Subject: A modest (:-) proposal Message-ID: <7144@brl-adm.ARPA> Date: Tue, 28-Apr-87 02:32:52 EDT Article-I.D.: brl-adm.7144 Posted: Tue Apr 28 02:32:52 1987 Date-Received: Wed, 29-Apr-87 05:15:15 EDT Sender: news@brl-adm.ARPA Lines: 33 Chris Torek explained the use of "volatile" and "const" to me; for example, a pointer to a device register might be declared volatile unsigned int * const csr = 0172150; meaning that the value of the pointer never changes, but the value in the pointed-to location could be read or written at any time. Given this sudden flash that "const" and "volatile" are just like "*", "[]" and "()" as far as declaration syntax goes, I was struck by the contrast between the nice, short, words to indicate pointer-ness, function-ness, etc and the terribly long words to indicate volatile-ness, etc. In the spirit of the language (with the kind assistance of Chris Torek, I hope he doesn't mind too much) I propose that we use "?" to indicate "volatile" and "=" to indicate "const". "Unsigned" is another of those long ones; that should be "+". Given this small overloading of the operators, the above declaration becomes +int ?*=csr=0172150; Of course, we don't need the "int", so it really becomes +?*=csr=0172150; It is also possible to solve the "how big is an char/short/int/long" controversy that occasionally pops up; obviously, we just use the number of bits as a declaration. Thus +?32*=csr=0172150; Of course, 32 is redundant on a VAX. David