[squeak-dev] What does the underscore do?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[squeak-dev] What does the underscore do?

Gary Dunn
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
[hidden email]
http://openslate.net/
http://e9erust.blogspot.com/
Sent from Slate001


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] What does the underscore do?

Julian Fitzell-2
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<[hidden email]> 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
> [hidden email]
> http://openslate.net/
> http://e9erust.blogspot.com/
> Sent from Slate001
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] What does the underscore do?

Nicolas Cellier
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 <[hidden email]>:

> 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<[hidden email]> 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
>> [hidden email]
>> http://openslate.net/
>> http://e9erust.blogspot.com/
>> Sent from Slate001
>>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] What does the underscore do?

Yoshiki Ohshima-2
At Sun, 7 Jun 2009 11:02:03 +0200,
Nicolas Cellier wrote:
>
> 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.

  If I understand it correctly, ASCII 63 did not have a left arrow.
ISO decided to dump it at the ISO/TC97/SC2 meeting 1963, and ASCII
adopted the decision, too.  There was some backward compatibility
transition time when companies stick to the left arrow for like a
decade and some software at that time was using it.

-- Yoshiki

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] What does the underscore do?

Yoshiki Ohshima-2
At Thu, 11 Jun 2009 23:11:40 -0700,
Yoshiki Ohshima wrote:
>
>   If I understand it correctly, ASCII 63 did not have a left arrow.
> ISO decided to dump it at the ISO/TC97/SC2 meeting 1963, and ASCII
> adopted the decision, too.  There was some backward compatibility
> transition time when companies stick to the left arrow for like a
> decade and some software at that time was using it.
 
  Not it is really going to an off topic, but BTW, this info was from
my acquaintance Dr. Yasuoka.  He is a real hacker and historian; along
the way to debunk the myths around the history of typewriter (there is
a great book), one of many his interesting finding was like this:

http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/publications/emoticon.html

-- Yoshiki