# workbench: how to extract a piece of code into a function

For example assume that the following code is given

f[x_, y_]:=
Block[{a, b},
a = Sin[x];
b = Cos[y];
c = a + b
]


and I want to change it into (without doing too much typing myself)

prepareAB[x_, y_] := {Sin[x], Cos[y]};

f[x_, y_]:=
Block[{a, b},
{a, b} = prepareAB[x, y];
c = a + b
]


Is this functionality available in workbench?

-
This seems to be a non-trivial enough transformation that I would not expect any support for this kind of refactorings. Besides, I personally don't find that the majority of my development time is spent on re-typing during such refactorings, so, for me at least, such a feature (even if existed) would not be a major productivity booster. – Leonid Shifrin Mar 26 '14 at 12:07
on my part, I needed that functinality rather often. I certanly would like to see it implemented. though I agree that it is a highly non-trivial in the context of mathematica. there is so much to keep track off... – zorank Mar 31 '14 at 18:40