On 29 Apr 2015, at 22:59, Glenn Cavarlé <glenn@cavarle.fr> wrote:
Hi,
I'm playing with Slots and MethodWrappers to customize instVar reading/writing and method calls. In my experiments, Slots and MethodWrappers hold meta-description objects used at runtime to apply some filters, validations and to compose or delegate methods behavior.
Interesting!
I'm really interested in the progress of MetaLink, I saw that it will be possible to use hooks like #instead or #arround. Are these hooks can replace the use of MethodWappers ?
Yes!
Will it be possible to call a MetaObject's method instead of a method's body and with the passed arguments ?
Yes, this will work very soon⦠in a simple version (only one replace link allowed). (Later this will be generalized AOP style as an #around with the possibility to âproceedâ to the replaced node). What I am porting now from the prototypes is the functionality to hand arguments over to meta objects. before links on methods are already working: link := MetaLink new metaObject: [ self halt ]. (ReflectivityExamples>>#exampleMethod) ast link: link. execute it: ReflectivityExamples new exampleMethod. (ReflectivityExamples>>#exampleMethod) symbolic "'21 <20> pushConstant: [ self halt ] 22 <C9> send: value 23 <77> pushConstant: 2 24 <21> pushConstant: 3 25 <B0> send: + 26 <7C> returnTopâ" (This example, too, shows that a block can be a meta object, this means that this can be used as a very easy to use instrumentation framework, too, without the need to create explicit classes and methods for meta objects).
The announcement of meta-levels gives me ideas, would not it be interesting to have something like meta-layers?
Yes!
For instance, in order to address a layer with no MetaObjects execution, a layer with MetaObjects for logging or breakpoints, an other layer with custom MetaObjects, etc. I don't see how it would be possible to limit the scope of the active layers configuration, just for a block evaluation for exemple... From RFMetaContext maybe, but how ?â¦
One thing I want to add is to make the condition (optionally) into an object and then allow reflectivitly to turn on/of links without having to actually change the #condition: itself. Then links themselves could target these control meta objects⦠It is definitly interesting. E.g. one might want to have break points active, yet run the tests with them disabled. Marcus