MathGroup Archive 2006

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

Search the Archive

Re: stytax error

  • To: mathgroup at
  • Subject: [mg66606] Re: stytax error
  • From: "John Jowett" <John.Jowett at>
  • Date: Mon, 22 May 2006 18:14:57 -0400 (EDT)
  • Organization: CERN - European Laboratory for Particle Physics
  • References: <e4mndn$6q0$>
  • Sender: owner-wri-mathgroup at

        I had a similar problems with a package auto-saved from notebooks 
recently.  In fact it was even stranger: I found that the packages worked 
fine with Mathematica on Windows but I got syntax errors when reading them 
into a Linux kernel (the same files from the same file system).   I found 
that I could fix the problem by converting the package file to Unix format 
(changing the end-of-line characters.   Finally I managed to track down the 
line where the error occurred: it was a usage message where I had typed 
something like

func:usage="text of message" ;

Note that I had typed a (useless but, I would have thought, harmless) space 
before the semi-colon. The line happened to be of a length such that it was 
broken when saved to give something like

func:usage="text of message" \

and this was causing the problem.  Eliminating the space fixed it.  This was 
inside a big package and was not on the line number mentioned in the error 
message so it was hard to track down.     Perhaps you have something similar 
in your file.

I would call this a bug.

John Jowett

"Chris Chiasson" <chris at> wrote in message 
news:e4mndn$6q0$1 at
On loading a package file, Mathematica says it finds a syntax error on
a certain line number (which I have located in emacs).

Here is the relevant code snippet:

Module[{stdexitout, xtemp}, stdexitout = {x, f, oldxL,
    oldfL, xL, fL, xU, fU, xmax, evalcount, evallimit, tol};
    Which[fU T fL, stdexitout, xU == xmax,
        Message[MessageName[FindUnimodalMinimum, "unbound"]];
        stdexitout, evalcount T
    evallimit, Message[MessageName[FindUnimodalMinimum, "
      evallimit"]]; stdexitout, True, xtemp = Min[(1 + a) xU - a xL, xmax];
      boundunimodaldecision[x, f,
          xL, fL, xU, fU, xtemp, ReplaceAll[f, Rule[x, xtemp]], xmax, \
evalcount + 1, evallimit, tol]]];

In the package file, the indicated line (on or before where the syntax
error occurrs, according to Mathematica) includes the following code:

The entire module statement is correct syntax, or at least it
evaluates without errors when executed in a notebook.

What, if anything, should I do about this?


  • Prev by Date: Re: Simplification and Arg[]
  • Next by Date: Re: Issue
  • Previous by thread: Re: stytax error
  • Next by thread: Re: Re: stytax error