[squeak-dev] What does the underscore do?
Gary Dunn
osp at aloha.com
Sun Jun 7 04:17:36 UTC 2009
As I was poking around in the system browser I came across code that
used an underscore as if it were an assignment statement. By that I mean
a _ where I would expect to see a :=. What does it do?
Several examples in the directory: method in FileList2.
directory: dir
"Set the path of the volume to be displayed."
self okToChange ifFalse: [^ self].
self modelSleep.
directory _ dir.
self modelWakeUp.
sortMode == nil ifTrue: [sortMode _ #date].
volList _ Array with: '[]'.
directory ifNotNil: [
volList _ volList, directory pathParts. "Nesting suggestion from RvL"
].
volList _ volList withIndexCollect: [:each :i | ( String new: i-1
withAll: $ ), each].
self changed: #relabel.
self changed: #volumeList.
self pattern: pattern.
directoryChangeBlock ifNotNil: [directoryChangeBlock value: directory].
--
Gary Dunn, Honolulu
osp at aloha.com
http://openslate.net/
http://e9erust.blogspot.com/
Sent from Slate001
More information about the Squeak-dev
mailing list
|