Help - Language - Squeak Semi-formally- 2

Previous - Squeak Semi-formally - Next

2. Interpunctions

If you look closely at any normal English written text of a page or more in length, you'll find that something like a third of it may consist of interpunction, like blanks, dots, commas and the like. Interpunctions serve as means of grouping characters and terms and to help the human reader. It is often referred to as "whitespace", precisely because in printing practice so much is indeed made up of white space without any character.

In  SL there is interpunction as well, and indeed its purpose is to help the human readers of the Squeak Language:

whitespace = [space | tab | newline]+.

This  is the whitespace  in SL, in fact mostly defined by reference to a standard keyboard, with a space and a tab key (both of which are represented in the computer by specific numbers: computers have no use  for whitespace).  Note that whitespace consists of one or more of space | tab | newline, as indeed conforms to human writing and typing practice.

There is a tricky bit involved in newlines, that correspond to the Enter-key on the keyboard: 

newline = cr | lf | crlf.

The tricky bit arises from the desire to cater to many OS-s: On a Mac newline is cr; on Unix newline is lf; and on Dos newline is crlf (so a sequence of the previous two).

In Squeak the standard newline is cr on all platforms, but this concerns only text written inside Squeak, and not text written on other systems and filed into Squeak, for which reason the lf and  crlf exist in Squeak.

Finally, the general  function of interpunction is to separate a term from surrounding terms:

separator = whitespace | comment.

This only adds comment, defined below as anything occuring between two double  quote-marks. Comments occur in the SL to help the user. When Squeak parses a human users input it skips all comments, effectively treating it as whitespace, with which it also does nothing (except permit its use).

Previous - Squeak Semi-formally - Next