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

MathGroup Archive 2007

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

Search the Archive

Transparently passing on options to other functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82227] Transparently passing on options to other functions
  • From: Art <grenander at gmail.com>
  • Date: Tue, 16 Oct 2007 03:16:14 -0400 (EDT)
  • Organization: University of California, Berkeley

Let functions f and g be defined as follows:

f[ OptionsPattern[{}] ] := OptionValue[optf];


Options[g] = {optg -> True};
g[opts : OptionsPattern[]] := OptionValue[optg] && f[opts]

The following gives a warning that optf is not an option value for
function g.

g[optg -> False, optf -> False]


Is there a good way to have OptionValue ignore this fact and not generate
a warning? What is the proper way to transparently pass through options to
other functions?

I would like to not do the following:

Options[g] = {optg -> True, optf -> Null};

which eliminates the warning.



  • Prev by Date: Stylesheet Cell properties question
  • Next by Date: Releasing several Holds simultaneously
  • Previous by thread: Stylesheet Cell properties question
  • Next by thread: Re: Transparently passing on options to other functions