Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

list referencing with [[ ]][[ ]]

  • To: mathgroup at
  • Subject: [mg13969] list referencing with [[ ]][[ ]]
  • From: tdelling at (Tim Dellinger)
  • Date: Fri, 11 Sep 1998 15:06:57 -0400
  • Organization: University of Illinois at Urbana-Champaign
  • Sender: owner-wri-mathgroup at

According to "the book" section 1.8.4,

t[[1]][[2]] "is equivalent to" t[[1,2]], "but is clumsier to write"

and that is all that I can find concerning the difference between the
two ways of refering to a list element.


 alist = {{1,2},{3,4}}; alist[[2,1]] = 7 ; alist


So far so good, and yet...

 anotherlist = {{1,2},{3,4}}; anotherlist[[2]][[1]] = 7
    "\!\(anotherlist \\[LeftDoubleBracket] 2 \\[RightDoubleBracket]\) in
 assignment of part is not a symbol."

What's the problem here?  Is there a difference between the two ways of
referencing list elements that "the book" neglects to mention?

"Perhaps my most deeply rooted hobby is to understand         Tim
 the mechanisms of simple and familiar                   
tdelling at
 natural phenomena." Irving Langmuir

  • Prev by Date: Black-Scholes and exotic options
  • Next by Date: Wolfram Research Grant Programs
  • Previous by thread: Re: Black-Scholes and exotic options
  • Next by thread: Re: list referencing with [[ ]][[ ]]