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 1997

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

Search the Archive

Re: Mathematica question (another one)

  • To: mathgroup at
  • Subject: [mg5751] Re: [mg5737] Mathematica question (another one)
  • From: Allan Hayes <hay at>
  • Date: Tue, 14 Jan 1997 10:42:29 -0500
  • Sender: owner-wri-mathgroup at

Gadi Oron <oron at>
[mg5737] Mathematica question (another one)

>How should i define a function that has an optional argument with  
>certain form, let me explain:
>Suppose that a function has to receive an OPTIONAL list of rules
>that takes the deafault value {}.
>I've tried :
>But it does not work.


f[Optional[sub:{___Rule} ,{}]]:= A[sub]

is OK on V3.0 but not on V2.2.


f[sub:{___Rule}:{}]:= A[sub]

is not accepted as proper input in V3.0 and, does not work in V2.2.

You might like to try  ___?OptionQ instead of ___Rule.

OptionQ[e] returns True if e can be considered an option or list of
   options, and False otherwise.

Allan Hayes
hay at

  • Prev by Date: M3 TeXSave
  • Next by Date: Printing to HP LaserJet4
  • Previous by thread: Mathematica question (another one)
  • Next by thread: Question: Purchase of Mathematica