~cpp ClassName>>methodName.~cpp 배울때 가장 자주 보는 에러 메시지 UndifinedObject(Object)>>doesNotUnderstand:
~cpp a := 1. b := OrderedCollection new.
~cpp
Money class>>amout: anAmount
self new setAmount: anAmount.
~cpp
TempTestCase>>initialize
super initialize.
~cpp
a := OrderdCollection new
add: 10;
add: 1;
add; 9;
yourself.
~cpp
Color>>alpha
...
^1.0
~cpp "Code in Bold" "Comments in double-quotes" 3 squared. "Receiver object is small integer 3." "The message sent is #squared" 'abc' asUppercase. "Receiver object is string 'abc'." "The message sent is #asUppercase" 200 factorial. "Receiver object is small integer 200." "The message sent is #factorial"
~cpp 3 negated "selector is #negated" 'abcdefg' reverse "selector is #reverse"
~cpp 3 + 5 "selector is #+" "argument is the Integer object 5" 'abc' , 'xyz' "selector is #, (comma character)" "argument is the String 'xyz'" 20 <= 20 "selector is #<=" "argument is the Integer object 20"
~cpp 3 raisedTo: 17. "selector is #raisedTo:" "argument is 17" 3 between: 5 and: 10. "selector is #between:and:" "arguments are 5 and 10" Point x: 4 y: 200. "receiver is the object Point" "selector is #x:y" "arguments are 4 and 200"