MathGroup Archive 2001

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

Search the Archive

Functions with Options

  • To: mathgroup at
  • Subject: [mg31984] Functions with Options
  • From: guillerm at
  • Date: Fri, 14 Dec 2001 16:53:20 -0500 (EST)
  • Sender: owner-wri-mathgroup at

[Please moderator, delete my previouos E mail]

I would like build functions with Options using Mathematica build-up functions 
with the same options.

Here is a naïf example:

newPlot[f_, {x_, min_, max_}, opts__] := Plot[f, {x, min, max}, opts]

If I use this function given options the solution is OK. i.e:

newPlot[Sin[x], {x, 0 , 2 Pi}, PlotRange -> All]

but, of course, it doen`t work if it not included options. i.e:
In[]:= newPlot[Sin[x], {x, 0 , 2 Pi}]

Out[]:= newPlot[Sin[x], {x, 0, 2 Pi}]

How it should be made the function in the way that it works given or not given 
values for options.  


This message was sent using Endymion MailMan.

  • Prev by Date: Re: Preserve subscripts like integers using N
  • Next by Date: Solved: Packed array generation and complex numbers
  • Previous by thread: Functions with Options
  • Next by thread: Re: Functions with Options