Hi all,
Monticello has a problem with this class construction:
ProtoObject subclass: #MyClass
instanceVariableNames: 'object'
classVariableNames: ''
poolDictionaries: ''
category: 'MyClasses.
MyClass superclass: nil
It forgets the last line with superclass specification.
I'm using it for proxy objects. Instances of MyClass have one variable to
store a real receiver of messages. MyClass resends messages using
doesNotUnderstand mechanism.
doesNotUnderstand: aMessage
^ aMessage sendTo: object.
It works well but there is one problem - Squeak uses optimalization of some
message calls. For example, message #class is never called, because Squeak
uses special bytecode 199 (bytecodePrimClass). Real class of proxy object is
returned instead of receiver class.
Message #isVariable returns wrong value for arrays, large integers etc. So I
have made a variable subclass of MyClass and I use it for proxy object of
variable receivers. It works well too.
I used this proxy objects for a dictionary and its instance variables
including tally. This variable stores a size of dictionary. When Squeak
makes a copy of dictionary array, he sends tally like a parameter in
constructor
of new array, but primitive method fails. VM wants an integer instance
strictly.
Any ideas?
Pavel