MathGroup Archive 1998

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

Search the Archive

Re: loading packages-followup

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14394] Re: loading packages-followup
  • From: "P.J. Hinton" <paulh>
  • Date: Sun, 18 Oct 1998 15:10:00 -0400
  • Organization: "Wolfram Research, Inc."
  • References: <703vqk$i23@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On 15 Oct 1998 sean_ross_at_pl-04m3 at smtpgw1.plk.af.mil wrote:


>      This is in response to my earlier question about why packages I
> wrote 
>      wouldn't load.  The answer is that code written in the 3.0.1
> FrontEnd 
>      and Saved As Special:Package Format is commented out in the save 
>      routine, thus all packages written in the front end and saved in
> what 
>      appears to be the intended manner have an extra (* at the front of
> the 
>      file and an extra *) at the end, effectively disabling the code. 
> If 
>      you remove these in a text editor, the package can be read in and 
>      everything loads just fine.  I now have two more questions related
> to 
>      this.
>      
>      1) is this placing of extra (* and *) in packages by the 
>      SaveAsSpecial:Package Format a "feature" or a "bug"?

The Save As Special -> Package Format command exports the contents of
cells which have the InitializationCell option set to True.  Contents of
cells that do not meet this criterion will be commented out.
      
>      2) The kernel knows to search the \ProgrammingInMathematica and the
> 
>      \Utilities subdirectories of the ExtraPackages folder.  If I put my
> 
>      own subdirectory in the ExtraPackages folder, the Kernel does not 
>      search there.  Why?  I got around it by appending the path to the 
>      $Path variable in the init.m, but I am still curious as to how the 
>      Kernel knew it was supposed to search only those two subdirectories
> 
>      but wouldn't search mine even though none of them was listed 
>      explicitly in the $Path.

Are you loading the package with a context name that reflects the
relative path from a directory on $Path?  For example, in order to load
the packages in the ExtraPackages directory, you have to issue commands
like:

	Needs["ProgrammingInMathematica`ChaosGame"]

because ExtraPackages is on $Path, but the ProgrammingInMathematica
subdirectory is not.

--
P.J. Hinton
Mathematica Programming Group           paulh at wolfram.com Wolfram
Research, Inc.                  http://www.wolfram.com/~paulh/
Disclaimer: Opinions expressed herein are those of the author alone.



  • Prev by Date: Re: Routines inside Epilog
  • Next by Date: Re: Adding equations
  • Previous by thread: loading packages-followup
  • Next by thread: Re: loading packages-followup