Question: CompiledMethod evaluation
Dan Ingalls
Dan.Ingalls at disney.com
Fri Jun 9 02:24:32 UTC 2000
> I'm working on a project that deals with message sending and reception.
>By now, I need a way to evaluate a CompiledMethod (retrieved from a
>class) on a given receiver (instance of that class)...
>
>In VisualWorks, there's something to deal with this:
>
>CompiledMethod >>valueWithReceiver:arguments:
>
>But, this is not available in Squeak. I guess there must be way to do
>it, as in fact the debugger can do the evaluation of methods.
>
>Some ideas ?? I'd really appreciate any HELP !!
Well, as others have said this is a gross violation of just about every good practise, but I've done similar things myself...
The approach I would take is to make up a very simple behavior with a very small MethodDict, and put your method into it with some selector. Then point that class's superclass at the class of the reciever and do a perform.
If this is in the inner loop of some simulation, my guess is you can keep this structure around, and accomplish what you want with only a couple of pointer stores of overhead.
- Dan
More information about the Squeak-dev
mailing list
|