[Reflectivity] What are the #arguments?

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

[Reflectivity] What are the #arguments?

roberto.minelli@usi.ch
Dear Marcus,

I am wondering where to ‘discover’ all the possible values for the #arguments: to pass to the MetaLink.

Cheers,
R

Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] What are the #arguments?

Marcus Denker-4
Hello,

every one of these “reifications” are defined as a subclass of
RFReification

There is one subclass for every symbol (e.g. for #arguments, there is RFArgumentsReification).
The class side method #key defines the exact symbol, while #nodes returns the AST node classes
where this reification is available.

I will make a full table soon that lists everything.

        Marcus

> On 25 Sep 2015, at 09:36, [hidden email] wrote:
>
> Dear Marcus,
>
> I am wondering where to ‘discover’ all the possible values for the #arguments: to pass to the MetaLink.
>
> Cheers,
> R
>


Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] What are the #arguments?

roberto.minelli@usi.ch
Thank you very much, Marcus!

Concerning the table..we can do a method that lists the #availableReifications or something like that ;)

For example, if I am interested in all the available reifications for an RBMethodNode I can do:
RFReification subclasses select: [ :e | e nodes includesAny: RBMethodNode withAllSuperclasses ].

Cheers,
Roby


> On 25 Sep 2015, at 09:51, Marcus Denker <[hidden email]> wrote:
>
> Hello,
>
> every one of these “reifications” are defined as a subclass of
> RFReification
>
> There is one subclass for every symbol (e.g. for #arguments, there is RFArgumentsReification).
> The class side method #key defines the exact symbol, while #nodes returns the AST node classes
> where this reification is available.
>
> I will make a full table soon that lists everything.
>
> Marcus
>
>> On 25 Sep 2015, at 09:36, [hidden email] wrote:
>>
>> Dear Marcus,
>>
>> I am wondering where to ‘discover’ all the possible values for the #arguments: to pass to the MetaLink.
>>
>> Cheers,
>> R
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] What are the #arguments?

Marcus Denker-4
Good idea, I will add #availableReifications

        Marcus

> On 25 Sep 2015, at 10:02, [hidden email] wrote:
>
> Thank you very much, Marcus!
>
> Concerning the table..we can do a method that lists the #availableReifications or something like that ;)
>
> For example, if I am interested in all the available reifications for an RBMethodNode I can do:
> RFReification subclasses select: [ :e | e nodes includesAny: RBMethodNode withAllSuperclasses ].
>
> Cheers,
> Roby
>
>
>> On 25 Sep 2015, at 09:51, Marcus Denker <[hidden email]> wrote:
>>
>> Hello,
>>
>> every one of these “reifications” are defined as a subclass of
>> RFReification
>>
>> There is one subclass for every symbol (e.g. for #arguments, there is RFArgumentsReification).
>> The class side method #key defines the exact symbol, while #nodes returns the AST node classes
>> where this reification is available.
>>
>> I will make a full table soon that lists everything.
>>
>> Marcus
>>
>>> On 25 Sep 2015, at 09:36, [hidden email] wrote:
>>>
>>> Dear Marcus,
>>>
>>> I am wondering where to ‘discover’ all the possible values for the #arguments: to pass to the MetaLink.
>>>
>>> Cheers,
>>> R
>>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Reflectivity] What are the #arguments?

Marcus Denker-4

On 25 Sep 2015, at 13:02, Marcus Denker <[hidden email]> wrote:

Good idea, I will add #availableReifications



I decided to return the symbolic encoded that is used when setting up the links:


testAvailableReifications
    self assert: (RBMessageNode new availableReifications includes: #receiver).
    self deny: (RBMessageNode new availableReifications includes: #value).
    self assert: ((ReflectivityExamples classVariableNamed: #ClassVar) availableReifications includes: #name).
    self deny: ((ReflectivityExamples classVariableNamed: #ClassVar) availableReifications includes: #selector).

(ReflectivityExamples classVariableNamed: #ClassVar) availableReifications

==>  "#(#value #name)

Marcus