MathGroup Archive 2011

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

Search the Archive

Please Help Eliminate My Ignorance

  • To: mathgroup at smc.vnet.net
  • Subject: [mg118542] Please Help Eliminate My Ignorance
  • From: Michael Mandelberg <mmandelberg at comcast.net>
  • Date: Mon, 2 May 2011 06:52:02 -0400 (EDT)

Why does Mathematica like the first, but not the second?

1.
Clear[x, testp, p];
test[p_] :=  Append[p, p[[4]]];


2.
Clear[x, testp, p];
test[p_] := x = 1; Append[p, p[[4]]];

Part::partd: Part specification p[[4]] is longer than depth of object.
>>

Append::normal: Nonatomic expression expected at position 1 in
Append[p,p[[4]]]. >>


  • Prev by Date: Scrolling in a new notebook
  • Next by Date: Re: Drawing a vector list
  • Previous by thread: Scrolling in a new notebook
  • Next by thread: Re: Please Help Eliminate My Ignorance