* Upper and Lower case
@ 1987-01-05 13:44 firth
0 siblings, 0 replies; only message in thread
From: firth @ 1987-01-05 13:44 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1987-01-05 13:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1987-01-05 13:44 Upper and Lower case firth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox