Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2028

Please Help Eliminate My Ignorance

From Michael Mandelberg <mmandelberg@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Please Help Eliminate My Ignorance
Date 2011-05-02 10:52 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ipm2cl$56f$1@smc.vnet.net> (permalink)

Show all headers | View raw


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]]]. >>

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Please Help Eliminate My Ignorance Michael Mandelberg <mmandelberg@comcast.net> - 2011-05-02 10:52 +0000
  Re: Please Help Eliminate My Ignorance "Sjoerd C. de Vries" <sjoerd.c.devries@gmail.com> - 2011-05-03 09:46 +0000

csiph-web