Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2001

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

Search the Archive

Options[] in Mathematica 4.1

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28718] Options[] in Mathematica 4.1
  • From: "James Jones" <j.k.jones at dl.ac.uk>
  • Date: Thu, 10 May 2001 07:55:02 -0400 (EDT)
  • Organization: Daresbury Laboratory
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

I have written several functions which take optional rules as arguments.
Upto now I have been parsing the rules inside the functions with

rule = Global`Rule /. {options} /. {Global`Rule -> True}; etc,

however I think this is causing problems with some other built in  functions
(where my option names are the same?). I have Seen another package (CERN's
mfs package) use

Options[function] = {Rule -> True}

then parsed as

rule = Global`Rule /. {options} /. Options[myfunction]; etc,

there doesn't appear to be any problems with this. However if I try this
with my functions, which are in a Private context and read in as part of a
package, and type Options[Myfunction] I get

{ Madtomma`madinput`madinput`Private`Rule -> True }

and the rules don't work properly. I can solve this by placing the
Options[myfunction] outside the private context of my package, but I was
wondering how it can be left next to the function definition in the private
context?

On a related point, if I have rules that have the same name as built in
rules (say PlotRange for some of my plotting functions) can I use these and
not affect the built in functions?

Any help much appreciated,

James Jones
Daresbury Lab.



  • Prev by Date: Re: Computer Science with Mathematica Book
  • Next by Date: Re: Auto Recalculation
  • Previous by thread: Implicit solutions for a system of de's
  • Next by thread: Re: Options[] in Mathematica 4.1