> On 10 Sep 2015, at 19:45, Peter Uhnák <i.uh...@gmail.com> wrote:
> 
> 
> 
> On Wed, Sep 9, 2015 at 10:04 PM, Marcus Denker <marcus.den...@inria.fr 
> <mailto:marcus.den...@inria.fr>> wrote:
> Hello,
> 
> The idea of Reflectivity is to be just that: a way to “hook” into code 
> without changing the source… this is a similar use case like
> the one described yesterday:
> 
> link := MetaLink new
>         metaObject: MyNotifyer;
>         selector: #notifyChangedVaNamed:;
>         arguments: #(name).
> 
> Ah, this is really cool and powerful, thanks!
> 
> I imagine in time tools will be built to have better control of this (for 
> example now stack trace in debugger looks really magical (suddenly there's a 
> frame from nowhere)), but all in time.
> 
Yes! One thing I want to add is to visualise links in the debugger (so that you 
can explore easily who hooked into what).  And provide a “step into meta”. 
functionality.

> Now when code is recompiled (loaded), you need to re-install the links in 
> those methods, it does not happen
> automatically.
> 
> Are there any scenarios when method is recompiled during regular Pharo run 
> and without user's invocation?
If nobody else does magic, just loading code or editing code.

> In other words, if I install the links after the package has been 
> loaded/updated and I will not be changing the code, will I be safe?
> 
If you want to be sure, you need to implement a layer above. (I want to provide 
a framework for that later to be reused)

-> Every change to code can be easily tracked by subscribing to the system 
notification mechanism
-> If a method changed that you are interested in —> reinstall the links.

> Also I am little bit scared that without tools I am brewing a recipe for 
> disaster, because this is very powerful and not controlled…
Indeed,

> maybe I should do real AST rewrites and recompile instead... or investigate 
> if I can somehow annotate Nautilus and debugger to show the links... hmm…

Link visualisation in the code will come, now with the new editor this is 
actually possible! But it will be after the whole base is stable and debugged...
But of course the “hidden” nature of the metalink is a tradeoff… rewriting code 
in a more visible way can be better depending on the situation.

        Marcus
 

Reply via email to