FW: Bug in class message behaviour

Roel Wuyts rwuyts at vub.ac.be
Wed Aug 23 14:23:10 UTC 2000


----------
From: Johan Brichau <johanb at asterix.rave.org>
Subject: Bug in class message behaviour
Date: woe, 23 aug 2000 4:13 PM



Concerns: bug? in the sending of a #class message.

I want to override the behaviour of the #class message. However, this
doesn't seem to work. The execution seems to jump my own definition of
#class and automatically proceeds to the #class primitive in Object.

The real strange thing is when stepping through the execution using the
debugger, then my own #class method gets executed. Or if I send the
message: 'perform: #class', then my own #class method also gets executed,
as it should be.

Attached is a small .st file containing a class Test with a #class method
where we inserted a 'self halt' to trace when we execute our own #class
method. If you do: 'Test new class', then you will notice that this does
not execute our proper #class method, but seems to automatically execute
the #class-primitive.
If you execute 'Test new otherMessage', which first halts and allows you
to open a debugger and step through the sending of the #class method, then
you will notice that our own #class method gets executed. The same counts
for executing 'Test new perform: #class'

Is this the result of some strange optimization? I tested this in
Squeak2.7 as well as Squeak2.8... same results.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Johan Brichau                    email: johan.brichau at vub.ac.be
Programming Technology Lab       tel  : +32 2 629 34 92
Vrije Universiteit Brussel
Pleinlaan 2                              Campus Etterbeek
B-1050 Brussel                         Building F, 10th floor
Belgium                                     room 10F729


-------------- next part --------------
Object subclass: #Test
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Test'!

!Test methodsFor: 'test' stamp: 'JB 8/23/2000 14:39'!
class
	self halt.
	^ super class! !

!Test methodsFor: 'test' stamp: 'JB 8/23/2000 14:41'!
otherMessage
	self halt.
	^ self class! !


More information about the Squeak-dev mailing list