Download Grace Draft Specification - Computer Science Department
Transcript
4
3.3
Revision 1853 committed on 2014-08-30 23:51:33Z by black
Identifiers
Identifiers must begin with a letter, which is followed by a sequence of zero
or more letters, digits and prime“’” or underscore “_” characters.
A single underscore “_” acts as a placeholder identifier: it is treated as
a fresh identifier everywhere it is used.
3.4
Reserved Words and Reserved Operators
Grace has the following reserved words and reserved operators. The ? indicates words related to design options not yet chosen.
class def inherits is method object
outer prefix return self Selftype(?) super type var where
. := = ; { } [ ] " ( ) : −>
3.5
Tabs and Control Characters
Newline can be represented by the unicode newline character, by carriage
return, or by line feed; a line feed that immediately follows a carriage return
is ignored.
Tabs and all other non-printing control characters (except carriage return, line feed, and line separator) are syntax errors, even in a string literal.
(Escape sequences include special characters in string literals.)
4
4.1
Built-in Objects
Done
The object done of type Done is Grace’s unit. Methods with no explicit result
return done. Done has no methods except for asString and asDebugString.
4.2
Numbers
Grace supports a single type Number. Number supports at least 64-bit precision floats.
Implementations may support other numeric types: a full
specification of numeric types is yet to be completed.
Grace has three syntactic forms for numerals (that is, literals that denote
Numbers).