MathGroup Archive 1999

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

Search the Archive

Re: calling routine before Needs[]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17238] Re: calling routine before Needs[]
  • From: "David Keith" <dkeith at hevanet.com>
  • Date: Fri, 30 Apr 1999 02:34:33 -0400
  • Organization: Hevanet Communications
  • References: <7f9fh4$51o@smc.vnet.net> <7fbqt3$crk$1@dragonfly.wolfram.com> <7fp5fl$3cv@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I missed the first of this . . . . but

Perhaps you're referring to the situation that occurs when the user of a
package mistakenly calls a function before loading the package, causing the
function symbol to be defined in the global context and overshadow the
package function even after the package is loaded.

If so, Maeder describes one way to prevent this in his book "Programming in
Mathematica". (I have the 1st edition where it's on p. 50.)  He suggests
importing the globa context in the package by using

    BeginPackage["YourPackageName`","Global`"]

Now there is only one symbol for function, and it is modified by the package
when loaded.


Dan Truong wrote in message <7fp5fl$3cv at smc.vnet.net>...
>Neat, but won't do...
>
>I can't just redefine the name of the functions in my pckage at each
>run...
>I need a way to delete all prior definitions of the routine or the
>variable.
>so I can redefine them safely, for example if the programmer calls a
>routine be
>fore it's file is loaded.
>
>Dan-
>
>David Reiss wrote:
>
>
>> In[1]:= ?Unique
>>
>> "Unique[ ] generates a new symbol, whose name is of the form $nnn.
Unique[x]
>> generates a new symbol, with a name of the form x$nnn. Unique[{x, y,
... }]
>> generates a list of new symbols. Unique[\"xxx\"] generates a new symbol,
with
>> a name of the form xxxnnn."
>




  • Prev by Date: Re: Extendraphics(&MathLink) package problem
  • Next by Date: INFORMATIONS
  • Previous by thread: Re: calling routine before Needs[]
  • Next by thread: Propositional Logic