Josef Eschgfaeller on Mon, 08 Feb 2016 20:08:32 +0100

• To: pari-users@pari.math.u-bordeaux.fr
• From: Josef Eschgfaeller <esg@unife.it>
• Date: Mon, 8 Feb 2016 20:08:24 +0100
• Delivery-date: Mon, 08 Feb 2016 20:08:32 +0100
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unife.it; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=MrerEXQMcUkvS8hiTyA8VNjmrXyewnQJgXQPY3RDDEk=; b=FqKPB49xCaqsT3/ZJecrskJ6zUE3XnheimK26sV/Q4V5Uv5Zzi87pzZbL+yo2IzcqM /WDcQbw8GTeRLtdv6xu1+xXq3p0hWWnkyYhTblZfYXFkigdJ3UmHkd8jprHJZdRM/c86 OnvWp2/xSf1nn60SgzpDr/xHPHfpTZ4FtdGgs=
• References: <CAFBvUatLPdXFeDCxU8Y6+0-ONfRkhTURESNuBOfB9a9PY+ns2g@mail.gmail.com> <20160208171149.GB18589@yellowpig>

```Bill Allombert wrote:

> One dirty way to do it in GP is:
> arity(f)=component(f,2)[1]

Many thanks - it seems that one
can obtain in this way also the
implicit arity (see example):

If I understand well,
component(f,2)[2] is always the
value of the first argument, if this
is optional. Hence for

f (a=10,...)

it is 10. Since I use it for functions
which all have a single argument
which is a vector, whose length L
I know when I write the function,
but not when I apply some other
functions, it suffices to indicate L
as the optional value of the
argument. Artificial example:
--------------------------------------------------
implicitarity (f) = component(f,2)[2]

elaborate (f) = {my (n,e);
n=implicitarity(f); e=f([2,5,1]); n*e}

f (v=3) = {my ([x,y,z]=v); x+y+z}

t=elaborate(f)
print(t) \\ 24
--------------------------------------------------
Josef Eschgfaeller

```

• Follow-Ups: