Options[] creation
- To: mathgroup at smc.vnet.net
- Subject: [mg39217] Options[] creation
- From: Kyriakos Chourdakis <k.chourdakis at qmul.ac.uk>
- Date: Tue, 4 Feb 2003 02:21:31 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
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.
Best,
Kyriakos
_____+*"*+____+*"*+___+*"*+__+*"*+_
Kyriakos Chourdakis
Lecturer in Financial Economics
URL: http://www.qmw.ac.uk/~te9001
tel: (++44) (+20) 7882 5086
Dept of Economics
University of London, QM
London E1 4NS
U.K.