Dear Matthieu,
if you do
FIND
| `@temps |
``@.statsBefore.
self contract.
``@.statsAfter.
REPLACE
| `@temps party contract |
``@.statsBefore.
party := self partyOfType: PartyX withName: 'testName'.
contract := self contractForParty: party.
``@.statsAfter.
then the only problem is that methods which already have temps 'contract'
or 'party' will get duplicates which will cause compiler errors. This
could be avoided by programmatic rewritting using the
`{:dict | some code }
construct but it is tricky to fit that into temporaries instead of into
code. We will try and say more tomorrow.
Yours faithfully
Niall Ross
Adriaan van Os
> Hi all,
>
> I've some difficulties using the rewrite tool (part of the refactoring
browser).
> could somebody help me transforming the following line:
>
> self contract.
>
> with these two lines:
>
> party := self partyOfType: PartyX withName: 'testName'.
> contract := self contractForParty: party.
>
> where,
> party and contract are temp variables and should be declared.
> Most methods which have to be transformed will have some temp variables
already.
> PartyX is a class name.
> "self contract" is mostly the first statement within method, but not
always.
>
> Thanks in advance.
>
> Mathieu
>
--
http://www.a3aan.st--
http://www.a3aan.st