| Author |
Comment/Response |
Peter Pein
|
09/19/09 7:34pm
Hi,
sth. like a=5 is done by Mathematica via calling Set[a,5]. The function Set has the attribute HoldFirst set. You can ensure to get the second element of your list in the call to Set by "Evaluate"ing lst[[2]] first:
In[1]:= test[list_]:=Block[{x=2},Evaluate[list[[2]]]=x];
lst={a,b,c};
test[lst];
lst
Out[4]= {a,2,c}
Peter
URL: , |
|