[squeak-dev] What does the underscore do?

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sun Jun 7 09:02:03 UTC 2009


That's an old story.
ASCII 1963 had a left arrow (that then became an underscore) and an up
arrow (now the caret), so as many keyboard of th 60s.
Early Smalltalk adopted these characters because they were much more
expressive for assignment and return.
Also, as Smalltalk served to invent bitmaps, multiple windows, in the
70s, it used to include its own bitmapped fonts in the image.
Portability was not a problem in these golden ages, Smalltalk was a
whole system per se, and had no concurrent in the world.

The later inclusion of foreign fonts has broken the nice displayed arrows.
Some Smalltalkers still think that these arrows are so much expressive
that they refuse to switch, and still use proper fonts able to display
them.
Others think that it's no use fighting against standards, and better
including them.
What you see is a result of history and a certain level of indecision.

Nicolas

2009/6/7 Julian Fitzell <jfitzell at gmail.com>:
> It used to be the assignment character of choice in Squeak; it was
> displayed as a left-pointing arrow instead of an underscore.
>
> It's not portable between smalltalk though.
>
> Julian
>
> On Sat, Jun 6, 2009 at 9:17 PM, Gary Dunn<osp at aloha.com> wrote:
>> 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