[Q] Is it difficult to call plugins with receiver as argument?

Stephan Rudlof sr at evolgo.de
Sat Dec 25 20:15:19 UTC 1999


Dear Andrew, dear Squeakers!

I'm just before merging my plugin routines (LargeInteger arithmetics)
with the current system. For testing purposes it would be very nice to
have a method in TestInterpreterPlugin like
	perform: selector receiver: receiver withArguments: argArray
in addition to the existing one
	perform: selector withArguments: argArray
.. Do you think this is an easy or a difficult task?

Motivation: I want to replace e.g. Integer #digitAdd: by my own one in
LargePositiveInteger with the following properties:
- a plugin primitive should be called from there,
- if it fails it should call 'super digitAdd:'.

It would be nice if the receiver of the primitive could be set to
LargeInteger, but then it is fussy to test the plugin in Smalltalk
simulation mode, because it cannot called from elsewhere (wrong
receiver!).
Of course it is possible to workaround by calling the primitive with
'self' as additional argument what is my current approach. But I'd
prefer the other way...

There is a ContextPart method
	doPrimitive: primitiveIndex receiver: receiver args: arguments
but this seems to be quiet far away from TestInterpreterPlugin.


Any comments?


Greetings,

Stephan

P.S.: Andrew: _really_ the last one for today...
-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list