> On 15 Aug 2015, at 19:44, Cyril Ferlicot <[email protected]> wrote:
> 
> Can you give a little example of usecase to illustrate how this will be 
> useful please? :)
> 

The reason why I do that now is that I want to be able to put Meta Links on 
these variables.

This means, to “hook” into all accesses of x in Point, I want to be able to do:

        metaLink := MetaLink new
                                metaObject: Counter;
                                selector: #inc.

        (Point slotNamed: #x) link: metaLink.

==> on next call, any method that references the ivar x will be re-compiled 
just before execution with
the Link taken into account. Which means it will insert “Counter inc” before 
the access.

This works, too, on Globals. E.g. you want to #halt next time someone reads the 
global reference Object?
Just do

        Object binding link: (MetaLink new metaObject: Halt; selector: #now)

Lots of possibilities… and even for the raw properties I am sure people can 
find uses. E.g. the Quality assist
system actually annotates methods using properties instead of having internal 
private data structures. It could
attach information to *Variables*, too. Maybe other uses are possible, too. 
Could one store what we statically
know about the classes possible of a variable? 

        Marcus

Reply via email to