MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: list assignment problem




Abdallah Rayhan wrote in message <6jf5l1$47a@smc.vnet.net>...

>I am trying to write a program that requires handling 3D list. I am
>faced with this problem which is unable to change the values of the
>list. For example, when I run the following lines, I get this error
>msg: Part::setps: jlist[[1]] in assignment of part is not a symbol.
>
>In[294]:= jlist={{1,2},{3,4}}
>
>Out[294]= {{1, 2}, {3, 4}}
>
>In[295]:= jlist[[1]][[2]]=6
>
>Part::setps: jlist[[1]] in assignment of part is not a symbol.
>
>Out[295]= 6
>
>I would appreciate if any one could tell me what I am doing wrong ?
>

Abdallah,

This works

jlist[[1,2]]=6

The reason that  jlist[[1]][[2]]=6  does not work is, as the message
indicates. We have:

HoldForm[FullForm[jlist[[1]][[2]]=6]]

Set[Part[Part[jlist,1],2],6]

Allan

--
Allan Hayes
Training and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay@haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642





  • Prev by Date: Worldwide Mathematica Conference Training Opportunities
  • Next by Date: Re: Create Auto Save Package
  • Prev by thread: Re: list assignment problem
  • Next by thread: Re: list assignment problem