# SetAttribute for indicized variables? [duplicate]

Is there a way to SetAttributes to a function defined like this:

fun[t_][x_,y_]


Something like SetAttrubutes[fun[t_],Listable]?

• Only symbols, not indexed symbols can have attributes Jan 14 at 9:01

You could make fun[t] return a pure Function and make that one Listable like this:

fun[t_] := Function[{x, y}, DoSomething[x, y, t], Listable];


Here is a simple example:

X = Range[5];
Y = Range[5];
fun[t][X, Y]


{DoSomething[1, 1, t], DoSomething[2, 2, t], DoSomething[3, 3, t], DoSomething[4, 4, t], DoSomething[5, 5, t]}

However, I believe to remember that there was some performance issue with pure functions with Listable attribute (at least in some version of Mathematica). It's been a while ago. Maybe this issue has been fixed already.