| Author |
Comment/Response |
Sophi
|
02/03/12 4:41pm
Newbie here. Please excuse incorrect terminology I might use here ...
Below I can assign a field of a record at the top level at In[2], but I cannot do what looks like the very same assignment via a function call at In[5]. Why is this? Yes, I see the "is not a symbol" error but don't understand it. Thanks!!
In[1]:= r = rec["a",1]
Out[1]= rec[a,1]
In[2]:= r[[1]] = "b"
Out[2]= b
In[3]:= r
Out[3]= rec[b,1]
In[4]:= f[x_] := x[[1]] = "c"
In[5]:= f[r]
During evaluation of In[5]:= Set::setps: rec[b,1] in the part assignment is not a symbol. >>
URL: , |
|