MathGroup Archive 2010

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

Search the Archive

Re: Difficulty with saving Package .m files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110458] Re: Difficulty with saving Package .m files
  • From: "David Park" <djmpark at comcast.net>
  • Date: Sat, 19 Jun 2010 07:48:17 -0400 (EDT)

You are absolutely right! WRI is delinquent in showing how to do packages.
In the first place, they don't seem to be certain themselves what is a
preferred method. Nowhere do that take you through the steps that would work
for a typical user. I didn't really learn about Code cells until I started
using Workbench and also read some posts on MathGroup.

There might be one method for simple undocumented packages (basically using
notebooks and Initialization cells) and another method for more extensive
applications with documentation done in Workbench, where you might work with
the package.m files and Code cells.

WRI should really get this down because it is very important for serious
users who are trying to build up a body of knowledge and not just using
Mathematica as a calculator. 


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  



From: M Kelly [mailto:michaelkelly1444 at gmail.com] 


On Jun 17, 6:11 am, John Fultz <jfu... at wolfram.com> wrote:
> On Thu, 17 Jun 2010 02:04:10 -0400 (EDT), M Kelly wrote:
> > I am having difficulties in saving or editing the Package .m files.
> > If I open a .m file and attempt to make any changes to it and then
> > Save the file or even use Save As, then it always wraps every line
> > with (* *) annotation brackets, making the file unusable when I
> > attempt to load in the definitions with Get[].
>
> > Does anyone have a solution to this problem, or is it the case that
> > Mathematica is just forcing me to use the IDE Wolfram Workbench to
> > make any changes?
>
> > Any help would be appreciated.
>
> By default, cells created using the Code style will be saved as executable
code,
> while those created using the Input style will be saved as commented code.
The
> two styles are useful so that you can maintain code which you can execute
inside
> the front end for testing or bootstrapping purposes, but which doesn't get
> deployed for runtime use.
>
> If you open a .m file, you should be in an environment where all new cells
> created by default are Code cells.  If you're working with a .nb file,
then you
> will have to make sure to manually change the style to Code (Alt+8 or
Cmd+8, or
> Code under the Format->Style menu) before choosing the Save As command and
> creating a package file.
>
> Sincerely,
>
> John Fultz
> jfu... at wolfram.com
> User Interface Group
> Wolfram Research, Inc.

Hi again John

I have just gone through the documentation in version 7 and nowhere
can I find a reference to the Code style for cells. It is not
mentioned in the documentation for Cell, Style, Package (.m). And when
you go to the Front End and use the Menu Format->Style there is no
Code style explicitly mentioned.
You have to actually open a package, choose a cell and then go to
Format->Style->Other before it tells you that these are cells with the
style "Code".
Why the secrecy?
Especially since this is a very important aspect of the Mathematica
program: being able to store executable code!
Can this please be resolved with some documentation or others will
have the same unnecessary problems that I experienced.

Regards
Michael




  • Prev by Date: Re: Using Mathematica for Electrophysiology Data
  • Next by Date: Re: How to center the position of a control in the Manipulate pane?
  • Previous by thread: Re: Difficulty with saving Package .m files
  • Next by thread: Re: Difficulty with saving Package .m files