From: harbison@bert.pinecreek.com (Sam Harbison)
Newsgroups: comp.lang.modula3
Subject: Uppercase reserved words (was: Re: why modula3?)
Date: 6 Apr 92 14:58:54 GMT
Organization: Pine Creek Software, Pittsburgh PA

Re: the post FROM schwartz@groucho.cs.psu.edu (Scott Schwartz), who
RAISES an objection TO upper CASE identifiers.

To SET the RECORD straight, WHILE I have some sympathy FOR his point,
his EXCEPTION TO upper CASE identifiers is a too NARROW, AND NOT a
reason TO go through the CEILING.  (What VALUE a language FOR which
different compilers could OVERRIDE reserved word spelling?  I hope the
chance OF anyone using this LOOPHOLE is NIL.)  I DO NOT think upper
CASE id's have BRANDED Modula-3 a loser. We can DISPOSE OF that
argument.  It is NOT NEW AND there is no need TO REPEAT it.

Let me BEGIN TO ADDRESS this issue: TRUE, I used TO OBJECT TO upper
CASE reserved words when I FIRST saw them because they made my code
look ugly. That was UNTIL I got more experience. At LAST, I like them.
They cut down on on the name space pollution. I like being able TO use
ANY lower CASE identifiers (such AS "from" AND "to") IN my code.  A
close reading OF the book will REVEAL that that Modula-3 has about 100
reserved identifiers (TO use a ROUND NUMBER).  This includes
predefined identifiers WITH keywords. (It is a CARDINAL rule that you
can't use predefined identifiers FOR ANY other purpose IN Modula-3.)
IN the END, I think DEC simply had a BOOLEAN choice TO make, AND
they made it right.

TO avoid an EXTENDED debate AND RETURN TO the REAL issue, let me RAISE
a NEW possibility (OF some VALUE) IN the ARRAY OF solutions FOR GNU emacs
users.  TRY using abbrev mode--it's one OF the better METHODS.  IF you
TYPE your TEXT IN lower CASE, THEN you will get upper CASE reserved
words. I have included the necessary definitions below so you can
IMPORT them into your program.  Warning: Test before using, ELSE the
result may be UNSAFE. I didn't have time FOR a NUMBER OF tests. (Only
one.)

Sam Harbison 
Pine Creek Software; Suite 300; 305 South Craig Street; Pittsburgh, PA
15213; USA. Phone&FAX: +1 412 681 9811. E-mail: harbison@bert.pinecreek.com.

----

PROCEDURE: Change 'global-abbrev-table ' TO 'yourmode-abbrev-table '
IF necessary.  Read IN WITH M-x read-abbrev-file$.

(define-abbrev-table 'global-abbrev-table '(
    ("methods" "METHODS" nil 0)
    ("abs" "ABS" nil 0)
    ("loop" "LOOP" nil 0)
    ("raises" "RAISES" nil 0)
    ("return" "RETURN" nil 0)
    ("bitsize" "BITSIZE" nil 0)
    ("max" "MAX" nil 0)
    ("value" "VALUE" nil 0)
    ("cardinal" "CARDINAL" nil 0)
    ("exports" "EXPORTS" nil 0)
    ("set" "SET" nil 0)
    ("except" "EXCEPT" nil 0)
    ("nil" "NIL" nil 0)
    ("false" "FALSE" nil 0)
    ("or" "OR" nil 0)
    ("if" "IF" nil 0)
    ("eval" "EVAL" nil 0)
    ("min" "MIN" nil 0)
    ("narrow" "NARROW" nil 0)
    ("not" "NOT" nil 0)
    ("try" "TRY" nil 0)
    ("typecode" "TYPECODE" nil 0)
    ("boolean" "BOOLEAN" nil 0)
    ("text" "TEXT" nil 0)
    ("loophole" "LOOPHOLE" nil 0)
    ("unsafe" "UNSAFE" nil 0)
    ("readonly" "READONLY" nil 0)
    ("record" "RECORD" nil 0)
    ("import" "IMPORT" nil 0)
    ("branded" "BRANDED" nil 0)
    ("raise" "RAISE" nil 0)
    ("any" "ANY" nil 0)
    ("array" "ARRAY" nil 0)
    ("extended" "EXTENDED" nil 0)
    ("repeat" "REPEAT" nil 0)
    ("typecase" "TYPECASE" nil 0)
    ("end" "END" nil 0)
    ("of" "OF" nil 0)
    ("bytesize" "BYTESIZE" nil 0)
    ("lonreal" "LONREAL" nil 0)
    ("override" "OVERRIDE" nil 0)
    ("reveal" "REVEAL" nil 0)
    ("subarray" "SUBARRAY" nil 0)
    ("while" "WHILE" nil 0)
    ("ref" "REF" nil 0)
    ("var" "VAR" nil 0)
    ("new" "NEW" nil 0)
    ("const" "CONST" nil 0)
    ("procedure" "PROCEDURE" nil 0)
    ("round" "ROUND" nil 0)
    ("mutex" "MUTEX" nil 0)
    ("to" "TO" nil 0)
    ("ceiling" "CEILING" nil 0)
    ("mod" "MOD" nil 0)
    ("until" "UNTIL" nil 0)
    ("val" "VAL" nil 0)
    ("object" "OBJECT" nil 0)
    ("with" "WITH" nil 0)
    ("module" "MODULE" nil 0)
    ("integer" "INTEGER" nil 0)
    ("refany" "REFANY" nil 0)
    ("bits" "BITS" nil 0)
    ("char" "CHAR" nil 0)
    ("float" "FLOAT" nil 0)
    ("then" "THEN" nil 0)
    ("last" "LAST" nil 0)
    ("trunc" "TRUNC" nil 0)
    ("address" "ADDRESS" nil 0)
    ("dec" "DEC" nil 0)
    ("finally" "FINALLY" nil 0)
    ("null" "NULL" nil 0)
    ("and" "AND" nil 0)
    ("do" "DO" nil 0)
    ("else" "ELSE" nil 0)
    ("istype" "ISTYPE" nil 0)
    ("untraced" "UNTRACED" nil 0)
    ("exception" "EXCEPTION" nil 0)
    ("begin" "BEGIN" nil 0)
    ("dispose" "DISPOSE" nil 0)
    ("floor" "FLOOR" nil 0)
    ("true" "TRUE" nil 0)
    ("lock" "LOCK" nil 0)
    ("by" "BY" nil 0)
    ("exit" "EXIT" nil 0)
    ("adr" "ADR" nil 1)
    ("div" "DIV" nil 0)
    ("real" "REAL" nil 0)
    ("type" "TYPE" nil 0)
    ("elsif" "ELSIF" nil 0)
    ("for" "FOR" nil 0)
    ("number" "NUMBER" nil 0)
    ("from" "FROM" nil 0)
    ("root" "ROOT" nil 0)
    ("interface" "INTERFACE" nil 0)
    ("first" "FIRST" nil 0)
    ("ord" "ORD" nil 0)
    ("case" "CASE" nil 0)
    ("adrsize" "ADRSIZE" nil 0)
    ("as" "AS" nil 0)
    ("in" "IN" nil 0)
    ("inc" "INC" nil 0)
    ))