[Cuis-dev] TemporaryToInstanceVariable Refactor with Arguments

Eric Brandwein brandweineric at gmail.com
Mon Dec 23 15:46:11 PST 2019


Great! I'll keep it in mind.


El lun., 23 dic. 2019 a las 9:05, Hernan Wilkinson (<
hernan.wilkinson at 10pines.com>) escribió:

> Thanks Erik!
> Integrated :-)
>
> I made a few refactorings because I created CodeNode as superclass of
> BlockNode and MethodNode to have some consistency when asking for
> temporaries and arguments. Please take a look so you are aware of that for
> next time
>
> On Sun, Dec 22, 2019 at 7:45 PM Eric Brandwein via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> Hi all,
>>
>> Continuing to the fixes to refactors, here's one for two bugs in
>> TemporaryToInstanceVariable.
>> First, the SmalltalkEditor wouldn't check if you were actually extracting
>> a temporary and not an argument, because both of them are
>> TempVariableNodes. This means you could try to make the Temporary to
>> Instance Variable refactor on an argument, and the debugger would pop up.
>>
>> Second, the TemporaryToInstanceVariable class didn't check if there was
>> already other block declaring an argument with the same name as the
>> temporary you were trying to extract, and so when trying to compile the
>> method without the temporary declaration the Parser would throw an error.
>> This one can be reproduced by writing this method:
>>
>> m1
>>     [ :a | ^a ].
>>     [ | a | ^a ].
>>
>> and calling the refactor on the declaration of a on the second block.
>>
>> Cheers,
>> Eric
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
>
> --
>
> *Hernán WilkinsonAgile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20191223/fb7f2484/attachment.htm>


More information about the Cuis-dev mailing list