Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!newshost.marcam.com!usc!howland.reston.ans.net!Germany.EU.net!Hamburg.Germany.EU.net!nuki.NetUSE.de!Kiel.Germany.EU.net!tpki.toppoint.de!mzo.toppoint.de!mzoer
From: mzoer@mzo.toppoint.de (Michael Zoerner)
Subject: Re: A Little More Smalltalk...
X-Newsreader: TIN [version 1.2 PL2]
Organization: home
Message-ID: <1995Jun11.042735.365@mzo.toppoint.de>
References: <id.8ZLK1.8L9@nmti.com> <1995Jun10.125018.811@mzo.toppoint.de> <id.L1NK1.E89@nmti.com>
Date: Sun, 11 Jun 1995 04:27:35 GMT
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Lines: 45

Peter da Silva (peter@nmti.com) wrote:
> Thanks for the patch. I'll try it out.

> In article <1995Jun10.125018.811@mzo.toppoint.de>,
> Michael Zoerner <mzoer@mzo.toppoint.de> wrote:
> >     ->'Hello ' size; print
> >     66                         <- should be 'Hello Hello '

> No, this is correct. Little Smalltalk 3 also did cascading this way. It
> was a deliberate decision, documented in the book.

Well, I didn't read the book. Nor did I spend much time on Little 
Smalltalk besides on looking at the source. I just noticed that this 
behavior is different from other Smalltalk implementations. So it's 
a little bit, hmm, unusual. 

> >     ->globals at: #Test put: 'test '.
> >     test 
> >     ->Test print. globals at: #Test put: 'newval'. Test.
> >     test test                  <- should be 'test newval'

> This isn't documented. I see where you're getting at, though. I'm not
> sure this could be described as a bug so much as an undesirable
> undocumented feature. You think it's a performance hack?

You are right, this is not really a bug. It is just, again, different 
from other implementations of Smalltalk. The elements of the dictionary 
'globals' can be seen as something like 'global constants'. 
Changes of these elements (of course not the contents of the elements) 
at runtime will never be seen in the image without recompile.
You have a little performance advantage because you access the objects 
directly and not through associations but it is more error prone
(you can use the 'same' global with different values in different 
methods). 
Also it is difficult to use 'real' global variables in your program.

All the above discussed features are surely deliberate decisions.
They have both advantages and disadvantages.
I just wanted to point out that they mean major incompatibilities to 
other Smalltalk implementations. They make for example the use of 
existing Smalltalk code impossible without extensive modification of
it.
-- 
Michael Zoerner  <mzoer@mzo.toppoint.de>
Kiel/Germany
