undefinedSelector question

Ian Piumarta piumarta at prof.inria.fr
Thu Jul 25 14:00:20 UTC 1996

> Why doesn't the 'undefinedSelector:...' run-time message include the
> sender as one of it's arguments?
> Wouldn't this allow some interesting things to be done 
> (e.g. implementing subjectivity)

Dunno about Self ('coz I haven't got a Sparc Ultra 9 zillion++ on which to
run it ;-) but it's trivial in Smalltalk.  I presume there's some easy way in
Self to do the equivalent of the following.

FWIW: load this into PS, instantiate a FooBar, and send it a message that it
doesn't understand: e.g. "FooBar new truncated".  The sender is identified
(correctly) as "nil".  When you do "FooBar new zonk", the #zonk method sends
self an unknown message, and the sender is identified (correctly) as "a
FooBar".  This works because you're guaranteed to have no intermediate
contexts between the context which sent the bad message and the resulting
invocation of #doesNotUnderstand:...

'From Objectworks\Smalltalk(R), Release 4.1 of 15 April 1992 on 25 July 1996 at 3:51:23 pm'!

Object subclass: #FooBar
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Zonkable Classes'!

!FooBar methodsFor: 'zonking'!

doesNotUnderstand: aMessage
		show: 'funny message sent from ';
		show: thisContext sender receiver printString!

	^self reallyZonk! !


------------------------------- projet SOR -------------------------------
Ian Piumarta, INRIA Rocquencourt,          Internet: Ian.Piumarta at inria.fr
BP105, 78153 Le Chesnay Cedex, FRANCE         Voice: +33 1 39 63 52 87
----------------------- Systemes a Objets Repartis -----------------------

More information about the Self-interest mailing list