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


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

Re: Please Help Eliminate My Ignorance

From David Skulsky <edskulsky@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Please Help Eliminate My Ignorance
Date 2011-05-03 09:46 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ipoiu8$g6m$1@smc.vnet.net> (permalink)

Show all headers | View raw


I believe the problem with the second case is that the definition of test[] ends after the x=1; statement.  Mathematica subsequently processes Append[p,p[[4]]]; separately.  Since p hasn't been defined, it generates an error.  To fix the problem, use (for example) parenthesis:

test[p_]:=(x=1;Append[p,p[[4]]]);

David

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


Thread

Re: Please Help Eliminate My Ignorance David Skulsky <edskulsky@gmail.com> - 2011-05-03 09:46 +0000

csiph-web