DougEdmunds wrote: > > It was pointed out that given an instance method > MyClass >> doSomething > that > MyClass do: [:each | each doSomething]. > can be expressed as > MyClass do: #doSomething. > > Can someone suggest something to read that explains the usage of # > here (#doSomething), the relation of methods to symbols, etc. >
Message selectors (in your example „doSomething“) are represented by Symbols. You might use it to parameterize the behavior of an object. For example you can pass a message selector to a PluggableButtonMorph to tell it, which message to perform, when the button is pressed. -- View this message in context: http://forum.world.st/Method-expressed-as-symbol-used-as-argument-tp3388864p3389162.html Sent from the Pharo Smalltalk mailing list archive at Nabble.com.
