[squeak-dev] Re: compiler whitewash

Eliot Miranda eliot.miranda at gmail.com
Thu Oct 23 18:11:25 UTC 2014

On Thu, Oct 23, 2014 at 11:03 AM, Marcel Taeumel <
marcel.taeumel at student.hpi.uni-potsdam.de> wrote:

> Some addon: I personally think that all variables are initialized with
> "nil".
> :)

Yes they are, and its one of the nice guarantees that Smalltalk makes that
all variables are initialized either to nil or, in non-object data to 0 or
Character value: 0.  But the compiler can't in general tell whether a
reference to a variable before it is assigned to is a mistake or not.  For
example in this:

| t |
self doSomethingWith: t

the compiler can't know whether t is being used correctly or not ever.  It
is pointless for the compiler to try and analyse any relevant
implementations of doSomethingWith: looking for e.g. ifNil: guards since
doSomethingWith: can be redefined.  Marcel, do you have some concrete
criteria for squashing the warning in certain cases?  If you have a good
set of criteria we can implement them, otherwise I think we have to accept
the inaccuracy of the warning.

> Best,
> Marcel
> --
> View this message in context:
> http://forum.world.st/compiler-whitewash-tp4785831p4786264.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141023/296cda9d/attachment.htm

More information about the Squeak-dev mailing list