>>
> ...or use objects as methods or method wrappers. I did a quick
> experiment with the package
>
> http://www.squeaksource.com/ObjectsAsMethodsWrap.html
>
> from Markus Gälli. Just had to fix the send of #removeSeletorSimply:
> with #removeSelectorSilently: to make it work (@Markus, could you add
> this or give me write access?).
>
> ((PackageInfo named: 'Morphic') classes gather: [ :each |
> ObjectAsOneTimeMethodWrapper installOnClass: each ]) inspect
>
> gets you a collection of wrapper objects which you can ask #executed.
> I opened all tools and menus in the image and got 2100 methods
> executed out of 6518.

Cool

I was doing because I thought that may be I could get a problem with  
superclass method :)


doesNotUnderstand: aMessage

        | sel |
        sel := aMessage selector.
        (Morph selectors includes: sel)
                ifTrue: [^ self copyMethod: aMessage from: Morph].
        (Object selectors includes: sel)
                ifTrue: [ self copyMethod: aMessage from: Object].
        ^ aMessage sentTo: self.


copyMethod: sel from: aClass

        | category |
        Transcript show: 'Does not understand ',  sel ; cr.
        category := (aClass organization categoryOfElement: sel).
        self class compile: (aClass sourceCodeAt: sel) classified: category.
        Transcript show: 'recompiled',  sel printString ; cr.


Stef
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to