Although not more concise, it might be worth noting (as pointed out by Wagner, p196) that a pure function may be made listable using Function[]
syntax (but not, as far as I am aware, with either #-&
or d |->
syntax).
{f1, f2} // Function[x, x[Exponent[#, Variables[expr]]] &, Listable](* {f1[Exponent[#1, Variables[expr]]] &, f2[Exponent[#1, Variables[expr]]] &} *)
The following will also work:
myfn = Function[x, (x[Exponent[#, Variables[expr]]] &), Listable];myfn[{f1, f2}](* {f1[Exponent[#1, Variables[expr]]] &, f2[Exponent[#1, Variables[expr]]] &} *)
But (as again pointed out by Wagner), the following won't, as the listable attribute is 'stripped off' when fn
is replaced by its ownvalue during evaluation:
fn = Function[x, (x[Exponent[#, Variables[expr]]] &)];SetAttributes[fn, Listable]fn[{f1, f2}](* {f1, f2}[Exponent[#1, Variables[expr]]] & *)