MathGroup Archive 2008

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

Search the Archive

Two bugs in Mathematica 6.01 ".m" packaging.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84954] Two bugs in Mathematica 6.01 ".m" packaging.
  • From: Scott Morrison <scott.morrison at gmail.com>
  • Date: Mon, 21 Jan 2008 04:08:30 -0500 (EST)

I've noticed two bugs in the way that Mathematica 6.01 creates ".m"
package files from initialisation cells in notebooks. (These came up
while updating one of my packages to work with Mathematica 6.01.)

First, "SuperPlus" is not saved properly.

To reproduce (at least on Windows XP, Mathematica 6.01), create a
notebook, and enter a^+, by typing "a ctrl-6 +". If you look at the
FullForm of this expression, you should see "SuperPlus[a]". Mark this
cell as an initialisation cell, and save the notebook, agreeing in the
dialog which asks if Mathematica should create a ".m" file from the
initialisation cells. Now try to load that ".m" file using Get. You
should get a syntax error in your "Messages" window. Looking inside
the ".m" file, you'll see "a^+", which is indeed a syntax error.

Second, order of exponents is sometimes broken in ".m" packages.

To reproduce, create a notebook, and enter x = (a^b)^c, by typing "x =
a ctrl-6 b", then selecting the "a^b" text, and then typing "ctrl-6
c". If you now ask for FullForm[x], you, should get
Power[Power[a,b],c]. Again, mark the cell as an initialisation cell,
save the notebook, and load the resulting ".m" file. Now ask for
FullForm[x], and you'll now get instead Power[a,Power[b,c]].

Oops! :-) I hope these bugs don't cause as much suffering to other
people as they caused to me.

At least for now, anyone wanting to try out these bugs can grab a copy
of a minimal notebook from
http://katlas.org/svn/QuantumGroups/trunk/tests/Mathematica6PackagingBugs.nb
which shows the examples described above.

Cheers,
Scott Morrison
scott at tqft.net


  • Prev by Date: Re: cleaning up imported data
  • Next by Date: Re: Wavelet "filter"?
  • Previous by thread: Re: Align decmal points
  • Next by thread: Re: Two bugs in Mathematica 6.01 ".m" packaging.