Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Options for a function

  • To: mathgroup at
  • Subject: [mg18116] Options for a function
  • From: Virgil Stokes <virgil.stokes at>
  • Date: Thu, 17 Jun 1999 12:26:46 -0400
  • Delivery-date: Thu Jun 17 14:21:49 1999
  • Sender: owner-wri-mathgroup at

The following simple function for testing
options does not work the way I expect
(Vers. 3.0.1).

Options[g] = {Opt1->BoxCar};
g[n_,opts___?OptionQ] :=
  opt1 = Opt1 /. {opts} /. Options[g];
  If[opt1 == BoxCar, ans = yes, ans = no];

If I use


then it returns


which is of course correct. However, if I use


then it returns


And, this is not what I would expect. In fact, I am
unable to get the

   ans = no

part of the If statement to execute. Why?

-- Virgil

  • Prev by Date: Mathematica Link for Excel
  • Next by Date: RE: Avoid meshing
  • Previous by thread: Re: Mathematica Link for Excel
  • Next by thread: Re: Options for a function