next up previous contents index
Next: 2.4 Methods Up: 2 Language Reference Previous: 2.2 Sending Messages   Contents   Index

2.3 Sequencing Expressions

Statements are the overall expressions between stop-marks, which are periods. In an interactive evaluation context, expressions aren't evaluated until a full (top-level) statement is expressed. The stop mark also means that statement's expression results aren't directly carried forward as an argument to the following expression; side-effects must be used to use the results. More specifically, each expression in the sequence must be evaluated in order, and one expression's side-effects must effectively occur before the next expression begins executing and before any of its side-effects occur.

Slate provides for a bare expression sequence syntax that can be embedded within any grouping parentheses, as follows:

Slate> 3 + 4. 
7

Slate> (7 factorial. 5 
 negated) min: 6. 
-5

The parentheses are used just as normal grouping, and notably, the 5 negated expression wraps over a line, but still evaluates that way.3 If the parentheses are empty, or the last statement in a sequence is followed by a period before ending the sequence, an ``empty expression'' value is returned, which is Nil by convention.


next up previous contents index
Next: 2.4 Methods Up: 2 Language Reference Previous: 2.2 Sending Messages   Contents   Index
Brian Rice 2005-11-21