MathGroup Archive 2004

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

Search the Archive

Re: using functions with package name prefixed.

  • To: mathgroup at
  • Subject: [mg45656] Re: using functions with package name prefixed.
  • From: "Peltio" <peltio at>
  • Date: Fri, 16 Jan 2004 19:58:39 -0500 (EST)
  • References: <bu8gma$aiu$>
  • Reply-to: "Peltio" <peltioNOSP at>
  • Sender: owner-wri-mathgroup at

"steve_H" wrote

>In Java for instance, I can write, which makes it more
>clear where foo() is located.
>Is there a way to do something like this in Mathematica?

I guess there is. Perhaps by changing BeginPackage["boo`"] and EndPackage[]
into Begin["boo`"] and End[] will avoid the actual context specified in
Begin to be loaded into the list of available contexts.






So a (rather explosive) file named Boo.m containing
and loaded with Get
should do what you want, I guess.

>and is there a way
>to only load the function that I need from the package without loading

I don't think so. Mathematica reads all package contents in one single gulp, AFAIK.
You can define a 'package' for each single function and load them one at the
time. I guess it is possibile to define 'stubs' to do that with packages.
Perhaps it's possibile to extend this method even to files thas use Begin
instead of BeginPackage. Or, better yet, maybe using ordinary packages
and then removing their contexts just after they have been loaded,
could solve your problems.

Have a look at the documentation for Contexts, Begin, BeginPackage and
DeclarePackage. I am sorry I can't help you more right now (time is a harsh
master : )) ), but I hope these hints can be of some help, anyway.

Invalid address in reply-to. Crafty demunging required to mail me.

  • Prev by Date: Re: Graphics positioning
  • Next by Date: RE: Wolfram Functions Site
  • Previous by thread: Re: using functions with package name prefixed.
  • Next by thread: Re: using functions with package name prefixed.