Classes can receive messages
Time now
> 9:18:36.304688 pm
The message now
is sent to the class Time
Date today
> 29 July 2015
The message today
is sent to the class Date
FileLocator workingDirectory
ZnEasy getPng: 'http://pharo.org/web/files/pharo.png'
ZnServer startDefaultOn: 8080
Note the Class
button pressed!
Counter class >> withValue: anInteger
self new
value: anInteger;
yourself
Counter withValue: 10
returns the class Counter
instead of a new instance
Counter class >> withValue: anInteger
self new
value: anInteger;
yourself
is equivalent to
Counter class >> withValue: anInteger
self new
value: anInteger;
yourself.
^ self
self
here is the class Counter
(the receiver of the message)
Counter class >> withValue: anInteger
^ self new
value: anInteger;
yourself
class
button/