calling routine before Needs[]
- To: mathgroup at smc.vnet.net
- Subject: [mg17093] calling routine before Needs[]
- From: Dan Truong <dtruong at irisa.fr>
- Date: Sat, 17 Apr 1999 03:34:58 -0400
- Organization: IRISA, FRANCE
- Sender: owner-wri-mathgroup at wolfram.com
When a user calls a routine prior to the Needs[] or Get[] then he automatically defines the routine. However, when the package is loaded afterwards, since the routine is already defined, the true routine from the package cannot be used (you get a warning though). When one writes a package, how can he guarantee that the routines of the package will override previous definition? I get nowhere with Clear[] or ClearAll[], Remove["Global`*RoutineName"] seems to work but will generate a warning if the user didn't make any mistake. Is there a standard/systematic method to tackle this problem? Another point: In my package I need global variables to hold informations - Is it legal (it seems possible at least) to declare variables in the package (ie package variables declared outside the routines of the package). When a notebook is saved as a package (.m file) it seems everything is removed but function declarations. - Another solution is to have a routine to build global variables at initialization. How can we tell a variable does not exist? Is there a routine like ExistQ or DefinedQ[] ?