Re: Length of actual parameters in a function call.
- To: mathgroup at smc.vnet.net
- Subject: [mg47096] Re: Length of actual parameters in a function call.
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Fri, 26 Mar 2004 03:55:37 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <c3udpe$9om$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
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