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 1995

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

Search the Archive

Re: Function parameters, using : and ?

  • To: mathgroup at
  • Subject: [mg2831] Re: [mg2813] Function parameters, using : and ?
  • From: Allan Hayes <hay at>
  • Date: Sat, 23 Dec 1995 03:18:24 -0500

rmarimon at (Ricardo Marimon)
>Subject: [mg2813] Function parameters, using : and ?
Finds that the following does not work

   Func[x_List, y_List, epsilon_(?NumberQ):10^-6] := Module[{},...]

The following variants work

   Func[x_List, y_List, epsilon:_?(NumberQ):10^-6] := Module[{},...]
   Func[x_List, y_List, epsilon:(_?NumberQ):10^-6] := Module[{},...]

Using HoldForm[FullForm[....]] each of the third entries gives the form

   	Pattern[epsilon, PatternTest[Blank[], NumberQ]],
   	Power[10, -6]

The abbreviation x_ for x:_ does not parse properly.

Allan Hayes
hay at

  • Prev by Date: Help, Monte Carlo Simulations
  • Next by Date: axis scaling with altenative values
  • Previous by thread: Function parameters, using : and ?
  • Next by thread: Re: Function parameters, using : and ?