Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2003
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2003

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

Search the Archive

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.


  • 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