CompiledMethod>>value:withArguments:

Michel Tilman mtilman at acm.org
Tue Dec 28 16:55:55 UTC 1999


>
> Don't you think we could solve this by doing something along the lines of:
> CompiledMethod>>
> valueWithReceiver: aClass Arguments: argList
>  | aProcess aContext |
>  aContext _ MethodContext
>     sender: thisContext sender
>     receiver: aClass
>     method: self
>     arguments: argList.
>  aProcess _ Process forContext: aContext priority: Processor
activePriority.
>  aProcess resume
> ?
>

Method wrappers are an extremely useful technique to gather all kinds of
run-time information, to implement wrappers, ... One of their main benefits
is that they are sufficiently lightweight and fast to be really useful (e.g.
I collect run-time type information, and the system still responds fairly
well).

It seems to me that Squeak is missing in reflective facilities in message
handling. For that matter, so are most Smalltalk VM's. For instance, I have
never understood why we should rely on "#doesNotUnderstand:" to implement
proxies instead of having more direct support for efficient, dynamic message
handling. Seems kind of weird to implement e.g. a proxy's *intended*
behavior in 'error handling' routines, not to mention the fact that we have
to specify the behavior we do not want to inherit when subclassing nil,
rather than being able to define (by enumeration, pattern matching,
constraints, whatever...) the protocol we do want to intercept.

michel

=====
mtilman at acm.org
http://users.pandora.be/michel.tilman





More information about the Squeak-dev mailing list