Help - Language - Squeak Semi-formally - 1
Previous - Squeak Semi-formally - Next
1. Letters and digits
Since Squeak is a formal language like ordinary algebra - which I suppose you
to be somewhat familiar with - and is made up for a computer from strings of
characters it makes sense to
start with saying from what letters and other squiggles the well-formed
strings of the Squeak Language (SL) are composed
|
letter = uppercase | lowercase. |
Letters in SL are either uppercase or lowercase, and specifically these are
|
uppercase = "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z". |
|
lowercase = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z". |
So the "letters" of Squeak are just what an English-speaking person
would expect and what can be found on a standard English qwerty-keyboard as
such. In any case, also in what follows, the vertical stroke "|"
without quotation-symbols is like an exclusive or. Thus in uppercase the
intended meaning is: Any one of "A" .... "Z" (without
surrounding quotation- marks) is an uppercase letter and indeed nothing else.
There are more letter-like squiggles in English and on qwerty-keyboard, and for Squeak these are named a bit differently from standard EnglishL
|
character = ("[" | "]" | "{" | "}" | "(" | ")" | "_" | "^" | ";" | "$" | "#" | ":" | "-" | "|" | ".") | decimal_digit | letter | special_character. |
|
special_character = ("+" | "*" | "/" | "\" | "~" | "<" | ">" | "=" | "@" | "%" | "&" | "?" | "!" | "`" | "," ). |
What are called the "characters" of SL are mostly used in Squeak as grouping terms, and the special_characters indeed have special roles, mostly in arithmetical or logical statements.
The numerical symbols in Squeak are again what English speakers would expect:
|
decimal_digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9". |
A decimal_digit in Squeak is precisely what one would expect it is, and more generally
|
digits = [digit]+ |
are squences of one or more digits. So "digits" are squences made up of one or more digit-characters, but a terminological oddity (probably due to the use of letters in arithmetical systems that have more that 10 basic digits, for which capital letters are normally used) is that a digit is not just a decimal_digit, but may also be am uppercase letter:]
|
digit = decimal_digit | uppercase. |