On Tue, Nov 17, 2015 at 1:25 PM, Thierry Goubier <thierry.goub...@gmail.com>
wrote:

>
>
> 2015-11-17 13:20 GMT+01:00 Peter Uhnák <i.uh...@gmail.com>:
>
>> Thanks!
>>
>> One more question though: is it possible to somehow reference the
>> method's name?
>>
>> For example I would like to rewrite method
>>
>> [[[
>> navy
>> ^ self fromHexString: '000080'
>> ]]]
>>
>> to
>>
>> [[[
>> navy
>> ^ ColorRegistry at: #navy ifAbsentPut: [ self fromHexString: '000080' ]
>> ]]]
>>
>> of course for that I would need to know the selector's name...
>>
>> ^ ColorRegistry at: ``@selector ifAbsentPut: [ self fromHexString:
>> ``@color ]
>>
>> Is it possible?
>>
>
> In RBParseTreeRewriter, yes.
>

Could you give me an example? I am not sure how the "variable" parts are
expressed (since unlike RewriteTool there is not even a useful class
comment for the replacement).

Thanks,
Peter

Reply via email to