Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1478

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

From "Nasser M. Abbasi" <nma@12000.org>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: writing own package: cannot read it in..
Date 2011-04-05 10:42 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <inern4$j69$1@smc.vnet.net> (permalink)
References <inc6m2$vl$1@smc.vnet.net>

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

writing own package: cannot read it in.. Stuart Little <grobber@gmail.com> - 2011-04-04 10:31 +0000
  Re: writing own package: cannot read it in.. "Nasser M. Abbasi" <nma@12000.org> - 2011-04-05 10:42 +0000

csiph-web