MathGroup Archive 2001

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

Search the Archive

confusing Mathematica?


I've got a rather length function consisting of a module within a block
within a block.  Within the module is a while statement containing at a
particular point an if within a replace within an if.

Upon routine editing I happened to make the following change:

...
If[<condition>,
    (* Here I inserted the rest of this line: *) Map[(X)&,vars];
   (* This comment was already here... *)
  If[<valid stuff here>];
,


and suddenly I get a huge syntax error looking something like this...

Syntax::sntxf :
"If [<<1>>,<<1>>]; cannot be followed by "(code snipped)".

The error is nowhere near where I actually insert the line.  The problem is,
when I delete the line I just added I *still* get an error.  The way the
front end spuriously moves text around while I am trying to complete
brackets and braces is most unhelpful, and I thought perhaps I had made a
change somewhere else in the function without realizing it.  But after a
long time trying to figure out where the error is, I ran diff against the
original function and the function Mathematica doesn't like, and there is no
difference.

Any ideas what is going on here?  Am I confusing Mathematica with so many
things nested inside each other?

Michael




  • Prev by Date: Re: matrix columns
  • Next by Date: Re: Calculating Covariance Matrix
  • Previous by thread: 2^3^4^5 in Mathematica?
  • Next by thread: Re: confusing Mathematica?