[comp.lang.ada] Upper and Lower case

firth@SEI.CMU.EDU (01/05/87)

Mike Linnig asks how the LRM authors
would have represented Ada using only
one type font and two letter cases.

The common style adopted internally by all the
LRM authors was to put Ada keywords in lower
case and identifiers in upper case:

	package KEY_MANAGER is
	    type KEY is private;
	    NULL_KEY : constant KEY;
	    ...
	end KEY_MANAGER;

This style agreed with the prejudices of some of us,
but was objectionable to others of us; however, the 
benefits of a common style clearly outweighed any
subjective feelings.

The reasons for this style were

(a) Keywords and identifiers should be clearly
    distinguished, eg by more than just capitalisation.

(b) Identifiers are more important - you need to read
    them and understand their natural-language meaning.
    Keywords should be unobtrusive.

(c) When discussing Ada, it is helpful to use upper-case
    for identifiers, since then you can use them in any
    explanatory text without typographical change:

	"Outside of the package KEY_MANAGER, the operations
	 available for objects of type KEY..." [RM 7.4.2(14)]

When deciding on fonts for the LRM, we retained upper-case
roman for the identifiers, but followed the Algol tradition
of using lower-case bold for the keywords.  This was because

(a) It made the examples look better

(b) We could now also embed keywords in explanatory text without
    extra typopgraphy:

	"The declared object is a @i(constant) if the reserved
	 word @b(constant) appears in the object declaration..."

    Note that the italicised "constant" is an english word being
    emphasised; the bold "constant" is the Ada keyword. [RM 3.2.1(2)]

When designing the Alsys "Lessons on Ada", we tried to use colour as
well as case to distinguish keywords and identifiers.

Robert Firth

PS: should you care, my own preference is the opposite of the above:
    keywords in upper case and identifiers in lower case.  With a
    break character ('_') you don't need internal upper-case letters.