MathGroup Archive 2000

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

Search the Archive

Re: Big trouble with Mathematica Code parsing -- Rant.

  • To: mathgroup at
  • Subject: [mg26254] Re: [mg26244] Big trouble with Mathematica Code parsing -- Rant.
  • From: Jean-Marie THOMAS <jmt at>
  • Date: Sun, 10 Dec 2000 00:19:30 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

I met the same kind of problems when writing notebooks designed to generate 
.m files, using the InitializationCell feature.
I came to the conclusion the parser converting cells has some weaknesses :
- if the cell is quite long (for instance a CompoundExpression), the nesting 
of expression fails and it is necessary to add parenthesis pairs ;
- if the cell contains too many boxed expressions, the parsing fails and it 
is necessary to suppress boxes and replace them with one-dimensional 

Conclusion : when writing a package, check the generated file. If it contains 
input form data, modify the notebook.

On Wednesday 06 December 2000 08:16, Louis M. Pecora wrote:
[[ This message was both posted and mailed: see
   the "To," "Cc," and "Newsgroups" headers for details. ]]


I have just spent another 3 hours debugging Mathematica code that, for
some reason unclear to me, insists on putting Null's into the return
values, as in

Null  Return[{1.0,2.9}]   (in which the numbers are right, but the
Null's don't belong)

Rather than just returning


Where are they coming from?  Beats me.  This is the third time in the
last month or so that I've spent the better part of a day (a few days
in some cases) trying hard to figure why Mathematica parses my code in
a brain-dead way.

Beware.  Adding white space and blank lines for readability can cause
Null's  to appear and other problems.  I suspect this is partly related
to the fact that space can be taken as a multiplication, but
eliminating spaces and blank lines may not cure the problem.  I know.
I've tried.

I've done things such as copy the code into a text editor then right
back to Mathematica and then it works...until I change something or
open up the file later and try to use it.  Then I may get a syntax
error or just more Nulls, again.  Sometimes recopying the code out and
in will fix it, again. Sometimes not.  But what a Kludge!

Mathematica is doing things behind the scenes to the text in its
parsing and it messes stuff up.  Mathematica Support have responded
with hints such as Set Save in Box Form to False, eliminate white space
(there goes readability), make sure all lines end in ";" (that one, at
least, makes sense).  I've done it all and still have problems.

It is ridiculous when one of the most powerful sofeware packages in the
world cannot parse code correctly.  It cannot handle simple, clear
white space correctly.  And it insists on changing things which cause

These are not feature or even bugs.  They are FLAWS.

Maybe it's the automatic indenting.  I don't know.  I am totally
frustrated.  If anyone knows of anyway to turn off or on some setting
to get this program to just handle my code sensibly, PLEASE let me

I hope Wolfram is listening.  There is a serious upgrade-FIX needed for
Mathematica 4.0.  Right now I would not recommend this program to
anyone in my lab.


My views are my own.

  • Prev by Date: "?" to find symbols
  • Next by Date: Re: Getting coordinates of array member
  • Previous by thread: Re: Big trouble with Mathematica Code parsing -- Rant.
  • Next by thread: Re: Big trouble with Mathematica Code parsing -- Rant.