19.11.2014 Views

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

The Fortress Language Specification - CiteSeerX

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix D<br />

Rendering of <strong>Fortress</strong> Identifiers<br />

In order to more closely approximate mathematical notation, <strong>Fortress</strong> mandates standard rendering for various input<br />

elements, particularly for numerals and identifiers, as specified in Section 5.17.<br />

In this Appendix, we describe the detailed rules for rendering an identifier.<br />

If an identifier consists of letters and possibly digits, but no underscores or other connecting punctuation, prime marks,<br />

or apostrophes, then the rules are fairly simple:<br />

(a) If the identifier consists of two ASCII capital letters that are the same, possibly followed by digits, then a single<br />

capital letter is rendered double-struck, followed by full-sized (not subscripted) digits in roman font.<br />

QQ is rendered as Q RR64 is rendered as R64<br />

ZZ is rendered as Z ZZ512 is rendered as Z512<br />

(b) Otherwise, if the identifier has more than two characters and begins with a capital letter, then it is rendered in roman<br />

font. (Such names are typically used as names of types in <strong>Fortress</strong>. Note that an identifier cannot consist entirely of<br />

capital letters, because such a token is considered to be an operator.)<br />

Integer is rendered as Integer Matrix is rendered as Matrix<br />

TotalOrder is rendered as TotalOrder BooleanAlgebra is rendered as BooleanAlgebra<br />

Fred17 is rendered as Fred17 R2D2 is rendered as R2D2<br />

(c) Otherwise, if the identifier consists of one or more letters followed by one or more digits, then the letters are<br />

rendered in italic and the digits are rendered as roman subscripts.<br />

a3 is rendered as a 3 foo7 is rendered as foo 7<br />

M1 is rendered as M 1 z128 is rendered as z 128<br />

Ω13 is rendered as Ω 13 myFavoriteThings1625 is rendered as myFavoriteThings 1625<br />

(d) <strong>The</strong> following names are always rendered in roman type out of respect for tradition:<br />

sin cos tan cot sec csc<br />

sinh cosh tanh coth sech csch<br />

arcsin arccos arctan arccot arcsec arccsc<br />

arsinh arcosh artanh arcoth arsech arcsch<br />

arg deg det exp inf sup<br />

lg ln log gcd max min<br />

(e) Otherwise the identifier is simply rendered entirely in italic type.<br />

342

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!