Shadowed variables [was: Re: animated gifs]

Dan Ingalls Dan at SqueakLand.org
Tue Feb 22 22:10:18 UTC 2005


>On Tuesday 22 February 2005 12:31 am, Scott Wallace wrote:
>> Hi,
>>
>> Does anyone have any recent experience with using animated GIFs in Squeak?
>>
>> Theoretically animated-gif support arrived in Squeak 3.7.  However, I
>> have not been able successfully to load any animated gif into any
>> 3.7- or 3.8-based version of Squeak.  Whenever I try to "open" an
>> animated gif from a file-list, I always get an error.  Does this
>> happen to anyone else?
>>
>> Any advice much appreciated!
>
>Remove the local 'offset' variable in AnimatedGIFReadWriter>>allImages; it's
>shadowing the instance variable.

Just a note about QA of releases.  In the "old days", shadowing was considered an error, and one of the pre-release procedures was to recompile the whole system.  Thus, this bug would have been caught.

If we are going to allow this kind of shadowing, then I suggest that there be a system test equivalent to recompiling the system and locating shadowed variables.  They should be as much of a red flag as references to Undeclared.

	- Dan



More information about the Squeak-dev mailing list