MathGroup Archive 2003

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

Search the Archive

Options[] creation

  • To: mathgroup at
  • Subject: [mg39217] Options[] creation
  • From: Kyriakos Chourdakis <k.chourdakis at>
  • Date: Tue, 4 Feb 2003 02:21:31 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Dear all,

Suppose I create a function f[x_,opts___]
with options
Shape in {Circle,  Ellipsis} and Diameter in R+, DiameterLong in R+,
DiameterShort in R+
Say that the defaults are
Options[x]={Shape->Circle, Diameter->1.}

The option Diameter makes sence only when Shape->Circle, and
The options DiameterShort/Long make sense only when Shape->Ellipsis

Is there a quick way to tell Mathematica to warn if these conditions are
not satisfied? I could write a series of boolean tests, but I was wondering
if there is a more elegant way.




Kyriakos Chourdakis
Lecturer in Financial Economics

tel: (++44) (+20) 7882 5086
Dept of Economics
University of London, QM
London E1 4NS

  • Prev by Date: Re: Writing a program to hunt for a prime between n^2 and (n+1)^2
  • Next by Date: Re: Random Trouble
  • Previous by thread: RE: Aligned GraphicsArray
  • Next by thread: Re: Options[] creation