Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Transfering Packages Between Platforms and InputForm Conversions

1 view
Skip to first unread message

David Park

unread,
Jun 25, 2003, 2:12:22 AM6/25/03
to
MathGroup,

A week or so ago I asked Mac owners to help test several of my packages
written in Windows. I had had problems with several users not being able to
evaluate a package or notebook correctly on a Mac without errors although
they worked fine on Windows systems. A number of MathGroup participants were
kind enough to test. I thank them all.

One Mac person got no errors at all on one computer. Most Mac people got
fleeting warning messages (they came and went with hardly time to read them)
about Contexts but then everything evaluated properly. There is still one
Mac person who it won't evaluated for, but he is working with 4.0. When I
isolated the offending statement and converted it to InputForm, the fleeting
messages went away.

So I am still not certain as to the best method to write normal Mathematica
packages that will be platform independent. I think the WRI claim of
platform independence is not strictly true.

In any case, in some of my packages I starting going through to change all
the cells to InputForm. But then I discovered a very bad feature in doing
these conversions. If you name a variable Global`t, say, Mathematica throws
the Global` away! I think this is an outright bug. Sometimes, in a package,
I want to use a Global variable, for example if I am returning a
parametrization. (I always have it as an optional argument and allow the
user to supply another symbol if he wishes.) So Mathematica should not be
stripping contexts off symbols when converting to InputForm.

Another annoying feature of converting between Forms is that all comments
are stripped away. I think that some internal commenting in code can be very
useful. But now I've gotten into the habit of not using internal comments
because I know that sooner or later I'll do a conversion between forms and
Mathematica will throw it away. I think that comments should be retained and
considered a normal part of InputForm.

David Park
dj...@earthlink.net
http://home.earthlink.net/~djmp/


Selwyn Hollis

unread,
Jun 26, 2003, 5:52:01 AM6/26/03
to
Just some observations from my experience. (But I'm a Mac user, so...)

Packages need to good-old plain text---without the escape-character
soup that Mathematica often generates. So here's what I do: When ready
to create a package from working code, I (1) convert everything to
InputForm, (2) copy that into a plain text editor, and (3) edit that
until line breaks are where I want them, etc. I save that as a .m file,
and then resume work on it in Mathematica.

Works for me...

-----
Selwyn Hollis
http://www.math.armstrong.edu/faculty/hollis

0 new messages