MathGroup Archive 2006

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

Search the Archive

options as a matter of course (any advice?)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg69405] options as a matter of course (any advice?)
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Mon, 11 Sep 2006 05:38:49 -0400 (EDT)

I have begun to take notice of missing/undeclared options. This
results from the passing of options from a function that doesn't use
them or declare them to a function that does use them.

Let me give a short example:

gr[1]=Graphics[{Red,Line[{{1,2},{9,4},{5,6}}]}]

Show[gr[1],Axes->True]

In[3]:=
Options@Show

Out[3]=
{}

Show takes and "uses" the Axes option, even though it is not listed as
an option for Show.

This happens with other functions as well:
StyleForm has no options but seems to accept those of StyleBox
Cell has many options but also accepts Magnification, which is not on
its list of options.

This situation concerns me, because I am starting to code things this
way as well. I made a function that has an option called Exports (note
the s). The rhs of Exports is a list of option lists. These options
are passed to various functions, such as Export (without the s). I
need to add a useage message for Exports that describes this and lists
the various functions that see these options. Otherwise, it will be
hard for a user to know what will happen if she or he changes, adds,
or deletes an option from the nested list.

I am curious as to what can be done to curtail these situations,
because they lead to obfuscation of what code does.

-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Re: solve and Abs
  • Next by Date: Re: Re: solve and Abs
  • Previous by thread: Re: StylePrint and 2D strings
  • Next by thread: Re: options as a matter of course (any advice?)