MathGroup Archive 2004

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

Search the Archive

Re: Length of actual parameters in a function call.


Hi,

what may

MyFunction[a_, b_, c_] := a*b*c
MyFunction[a___] := Length[{a}]

do ? Print the number of paramters when it is not called
with 3 paramters ?

Regards
  Jens


"E. Martin-Serrano" wrote:
> 
> Hi,
> 
> A few weeks ago, reviewing some tutorials on pattern matching and error
> handling, I came across an undocumented function to monitor the number of
> parameters submitted to a function in a call; but somehow I lost its track
> later. I guess that it must be something well-known by our specialists. Any
> help about where to locate it?
> 
> The undocumented feature helps in tracking situations as when we define
> "MyFunction[a_,b_,c_]:= something" and then it is called as "myFunction[a]"
> leaving the function unevaluated.
> 
> E. martin-Serrano


  • Prev by Date: Re: eps export
  • Next by Date: Assumption -> quadratic multivariate function
  • Previous by thread: Length of actual parameters in a function call.
  • Next by thread: Re: Length of actual parameters in a function call.