I wrote a function
InversionF[f__] := Table[Function[x, 1 - ff[x]], {ff, {f}}]
I was thinking that for list of functions, it will create list of modified functions.
For one function it works:
InversionF[#^2 &]
gives
Function[y$, 1 - (#1^2 &)[y$]]
But for two functions it doesn't:
InversionF[#^2 &, #^3 &]
gives
{Function[x, 1 - ff[x]], Function[x, 1 - ff[x]]}
Although in first case I was expecting list of 1 element, which doesn't happen.
Why?
UPDATE
After restarting kernel, results became consistent but still not desired:
{Function[x, 1 - ff[x]]}
{Function[x, 1 - ff[x]], Function[x, 1 - ff[x]]}
Withseemed to give me something sensible, though:InversionF[f__] := Table[With[{g = ff}, 1 - g[#] &], {ff, {f}}]... for reasons which baffle me. – aardvark2012 Jul 22 '17 at 11:59InversionF[f__] := Table[With[{ff = ff}, Function[x, 1 - ff[x]]], {ff, {f}}]. If you disagree with closing, let me know. – Kuba Jul 22 '17 at 12:44