MathGroup Archive 1995

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

Search the Archive

Re: Function parameters, using : and ?

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

rmarimon at leland.stanford.edu (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[{},...]

Ricardo:
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

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

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

Allan Hayes
hay at haystack.demon.co.uk




  • 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 ?