(ZnEasy getPng: 'http://a.tile.openstreetmap.org/8/12/8.png')
asMorph openInWindow
receiver selector
9 squared
, Date today
receiver selector argument
1+2
3@4
receiver key1: arg1 key2: arg2
2 between: 10 and: 20
(Msg) > Unary > Binary > Keywords
()
This order minimizes ()
needs
But let us start with messages
anObject aSelector
1 class
> SmallInteger
false not
> true
Date today
> 24 May 2009
Float pi
> 3.141592653589793
1 class
> SmallInteger
Date today
> 27 June 2015
Point selectors
> #(#x #theta #quadrantOf: #onLineFrom:to:within: #bitShiftPoint: #< #scaleFrom:to: #sideOf: #'\\' #scaleTo: #grid: #'//' #asIntegerPoint #directionToLineFrom:to: ...)
Point selectors select: #isUnary
> #(#x #theta #asIntegerPoint #r #negated #normalized #sign #degrees #isIntegerPoint #guarded #fourNeighbors #eightNeighbors #min #max #ceiling #normal #asPoint #y #abs #isPoint #angle #transposed #reciprocal #asFloatPoint #asNonFractionalPoint #rounded #leftRotated #floor #truncated #hash #deepCopy #fourDirections #rightRotated #isSelfEvaluating #asMargin #isZero)
select:
is an iterator (see Iterator lecture)anObject aBinarySelector anArgument
1 + 2
> 3
2 > 3
> false
10@200
> 10@200
'Black chocolate' , ' is good'
> 'Black chocolate is good'
anObject keyword1: arg1 keyword2: arg2
equivalent to:
receiver.keyword1keyword2(arg1, arg2)
1 log
Browser open
2 raisedTo: 5
'hello', 'world'
10@20
point1 x
point1 distanceFrom: point2
1 log
(unary)Browser open
(unary)2 raisedTo: 5
(keyword)'hello', 'world'
(binary)10@20
(binary)point1 x
(unary)point1 distanceFrom: point2
(keyword)10@20 setX: 2
> 2@20
#('Calvin' 'hates' 'Suzie') at: 2 put: 'loves'
> #('Calvin' 'loves' 'Suzie')
#(...)
creates an arrayat:put:
changes the value of the array element.12 between: 10 and: 20
> true
between:and:
is sent to an integer10
and 20
Three kinds of messages: unary, binary and keywords
5 factorial
2 + 3
2 between: 0 and: 10
/