Adding new instance variables to Behavior...

Kevin R. Powell powell1 at uiuc.edu
Wed Jun 23 23:28:15 UTC 1999


I was working on a quick and dirty namespace implementation for squeak and
discovered a small problem.  If I add a new instance variable called
namespace to Behavior I get an error when the Dictionary class is being
recompiled (looks like the Dictionary class's instance variable offsets are
one off with respect to Behaviors new added inst. var.)

I had to redefine Behavior>>superclass: aClass to the following to get this
kind of change to proceed at all:

superclass: aClass
 "Change the receiver's superclass to be aClass."
 (aClass == nil
  or: [(aClass isKindOf: Behavior)
    or: [(aClass isKindOf: Metaclass)
      or: [aClass == Metaclass]]])
  ifTrue: [superclass _ aClass]
  ifFalse: [self error: 'superclass must be a class-describing object']

I am doing this on Windows/NT using 2.4c with all updates applied, however
this looks like something that should blow up on any OS type.

Kevin





More information about the Squeak-dev mailing list