To facilitate the use of this document, the following conventions are used:
Code examples are displayed in a typewriter font on a light gray background:
"the sum of two integer values" 3 + 4
The result of an evaluation, when it is given at all, is displayed in blue:
"the sum of two integer values"
3 + 4
=> 7
Occasionally you will be asked to enter some text. A proposal of input text is displayed on a gray background with a blue border:
PaintWindow
Code is often constructed stepwise and every step is shown as an example. Recently added code is shown in bold, removed text is struck out:
"first step" aView addSubView: DiagramDisplayView new
This is modified to become:
"first step" aViewaddSubView: DiagramDisplayView newaddSubView: DiagramDisplayView new below: headerView
Code fragements are displayed like example code, but additionally a green border is drawn around the example text:
| topView subView1 subView2 | < ... > subView1 window: (0 @ 0 extent: 20 @ 100). topView addSubView: subView1. subView2 window: (0 @ 0 extent: 80 @ 100). topView addSubView: subView2 toRightOf: subView1.
Occasionally, wrong code is discussed. As a general rule, wrong code is written in red:
"a wrong example"
[stream atEnd]
ifTrue: [stream close]
Complete class methods are marked with a blue bar on the left:
instanceFor: anObject ^self new owner: anObject
Complete instance methods are marked with a green bar on the left:
printOn: aStream aStream nextPutAll: self class name.
Class definitions are marked with an orange bar on the left:
Model subclass: #VariableSubViewExample instanceVariableNames: 'switch1 switch2 currentAspect graphicSubmodel textSubmodel' classVariableNames: '' poolDictionaries: '' category: 'MVCTutorial-AdvancedExamples'
An important note is displayed with a red bar on the left of the text:
A note that is emphasized by a red bar on the left should always be carefully read.
Mathematical expressions are displayed on a yellow background with a pale blue border:
1 an = 1 + --- n
Often, a convention or a requirement is best explained by an assertion, that is, by a logical expression that is required to hold. Assertions are written on a light green background:
elements allSatisfy: [:elem | elem isKindOf: Integer]
A class hierarchy is displayed on a pale yellow background. An underlined blue » following a class name depicts a link to a separate page with further information about that class:
Object » Magnitude » Number » Integer SmallInteger
The class catalog contains detailed information about the instance variables of many classes. On the class catalog pages, a variable name is written in light blue, its data type in red. The date type is underlined when additional information is available on a separate page.
Here is an example from the description of class View:
subViews - OrderedCollection
A collection of all subviews of the view. This variable is initialized to an empty
OrderedCollection, but some instance methods replace
this collection with nil.
The following assertion should hold:
subViews isNil or: [subViews allSatisfy: [:sv | sv superView == self]]