Login  Register

Re: [Ann] New version of Ghost

Posted by Denis Kudriashov on Mar 24, 2016; 7:22pm
URL: https://forum.world.st/Ann-New-version-of-Ghost-tp4886357p4886381.html


2016-03-24 20:27 GMT+01:00 stepharo <[hidden email]>:
Do you mean that you use subclasses to register selectors that will not be trapped? 
Why is is better than a collection on the object?

I not understand your question.
For example you want to make message #asString meta. You can implement it directly in class GHStandartMetaMessages:
GHStandartMetaMessages>>asString
"here there is instance variable ghost which you can use for implementation"
^'string presentation for ghost'

Now if you will define your proxy with standart meta level #asString will be not intercepted and instead GHStandartMetaMessages>>asString will be executed with ghost. 

In previous version you would add #asString to special map:
initializeMetaLevel
"many many other mappings here and new one"
notInterceptedMessages at: #asString put: #handleAsStringFor: