[Reflectivity] Progress with Reifications

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Reflectivity] Progress with Reifications

Marcus Denker-4
Hi,

in Pharo5  #120 we have lots of progress with Reflectivity regarding to “reificated values”.

1) more reificated value are working.

#arguments - an array of the arguments of a message send or method
#receiver - receiver of a message (or method executed)
#context for Methods
#sender for method and message

This means we have now all the info needed to e.g. pass all date needed to do a message send on the meta level.
(receiver, args, selector), or a variable store (#name, #newValue).

2) Reifications as arguments to conditions. When the block used as a condition has arguments, the name
is matched to the possible reifications and if valid this value is passed as an argument. Very useful e.g. for
object specific links:

link := MetaLink new
                condition: [: object | object == <the object I am intersted in>];
                metaObject: <someObject>;
                selector: <some selector>

This link would only be active for this one object.

3) Reifications as meta object
-------------

Every valid reified value can be the metaobject of the link. e.g. you can now define a link where the meta is the node where the Link is installed:

link := MetaLink new
                metaObject: #node;
                selector: #tagHasBeenExecuted.

Or the #receiver:

link := MetaLink new
                metaObject: #receiver;
                selector: #perform:withArguments:;
                arguments: #(selector arguments).

TODO

-> #slot, #global. #variable reifications
-> #after needs to wrap in ensure:
-> primitives
-> more tests
-> optimize link preambles: when reifying both #arguments and #receiver,
    merge the preamble into one for performance.
 
Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] Progress with Reifications

Gustavo Santos
Hello Marcus,

I wanted to modify some event creation in Epicea and I just used this mechanism.
It's pretty cool!

Cheers,

On Thu, Jun 18, 2015 at 2:36 PM, Marcus Denker <[hidden email]> wrote:
Hi,

in Pharo5  #120 we have lots of progress with Reflectivity regarding to “reificated values”.

1) more reificated value are working.

#arguments - an array of the arguments of a message send or method
#receiver - receiver of a message (or method executed)
#context for Methods
#sender for method and message

This means we have now all the info needed to e.g. pass all date needed to do a message send on the meta level.
(receiver, args, selector), or a variable store (#name, #newValue).

2) Reifications as arguments to conditions. When the block used as a condition has arguments, the name
is matched to the possible reifications and if valid this value is passed as an argument. Very useful e.g. for
object specific links:

link := MetaLink new
                condition: [: object | object == <the object I am intersted in>];
                metaObject: <someObject>;
                selector: <some selector>

This link would only be active for this one object.

3) Reifications as meta object
-------------

Every valid reified value can be the metaobject of the link. e.g. you can now define a link where the meta is the node where the Link is installed:

link := MetaLink new
                metaObject: #node;
                selector: #tagHasBeenExecuted.

Or the #receiver:

link := MetaLink new
                metaObject: #receiver;
                selector: #perform:withArguments:;
                arguments: #(selector arguments).

TODO

-> #slot, #global. #variable reifications
-> #after needs to wrap in ensure:
-> primitives
-> more tests
-> optimize link preambles: when reifying both #arguments and #receiver,
    merge the preamble into one for performance.


--
Gustavo Santos
Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] Progress with Reifications

ccrraaiigg

     "Reificated" is not a word. The word that means what you want is
"reified".


-C

--
Craig Latta
netjam.org
+31   6 2757 7177 (SMS ok)
+ 1 415  287 3547 (no SMS)


Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] Progress with Reifications

Marcus Denker-4
In reply to this post by Gustavo Santos

> On 11 Sep 2015, at 17:28, Gustavo Santos <[hidden email]> wrote:
>
> Hello Marcus,
>
> I wanted to modify some event creation in Epicea and I just used this mechanism.
> It's pretty cool!
>

Very good that is was helpful! If you find any problems, let me know… there will be many
cases where things are not yet working as they should. But it seems to get more stable
with each that we fix.

        Marcus


Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] Progress with Reifications

Marcus Denker-4
In reply to this post by ccrraaiigg

> On 11 Sep 2015, at 17:42, Craig Latta <[hidden email]> wrote:
>
>
>     "Reificated" is not a word. The word that means what you want is
> "reified".
>
>
Yes, I saw that just after pressing “Send”… should have send a correction.

        Marcus