MathGroup Archive 2011

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

Search the Archive

Re: writing own package: cannot read it in..

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117939] Re: writing own package: cannot read it in..
  • From: "Nasser M. Abbasi" <nma at 12000.org>
  • Date: Tue, 5 Apr 2011 06:42:41 -0400 (EDT)
  • References: <inc6m2$vl$1@smc.vnet.net>
  • Reply-to: nma at 12000.org

On 4/4/2011 3:31 AM, Stuart Little wrote:
> Hi,
>
> I've used Mathematica before, but I'm quite new to writing packages. Here's what I'm trying to do:
>
> I found the example
>
> BeginPackage["foo`"]
> Unprotect @@ Names["foo`*"];
> ClearAll @@ Names["foo`*"];
> f::usage = "f[x]"
> Begin["`Private`"]
> f[x_] := Module[{}, x^2];
> End[]
> Protect @@ Names["foo`*"];
> EndPackage[]
>
> in an online help file. I typed that thing in a new notebook,
>changed the cell to "Initialization cell", and also changed the style to "code",
>  saved it in a subdirectory somewhere in my Mathematica directory (this is Mathematica 8, by the way), and used the command


You must be referring to this page:

http://12000.org/my_notes/how_to_write_package_in_mathematica/index.htm

But I do NOT see anywhere in the above document where it says to do what
you did on your own initiative, which is

                         "and also changed the style to "code",

Why did you do that for?

How about trying the same steps again, but do not change the style to code? and
see if that works.

When I tried the the steps myself, it worked, but I did not have to change
style to code. There was no reason to.

--Nasser


  • Prev by Date: Re: PlotLegend and Show
  • Next by Date: Interpolation on a triangular region
  • Previous by thread: writing own package: cannot read it in..
  • Next by thread: Integation Anomoly