Josef Eschgfaeller on Fri, 22 Aug 2014 17:24:38 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Syntax for inner function
|
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: Syntax for inner function
- From: Josef Eschgfaeller <esg@unife.it>
- Date: Fri, 22 Aug 2014 17:24:31 +0200
- Delivery-date: Fri, 22 Aug 2014 17:24:38 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unife.it; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=pajaFkO7dBW+TeMdc7Vd1Y7bZVDvKa6DWNoZZOIBkvU=; b=Ld3SRInb/o3sGblYMoLG6wtWcgGSFLrxmvkYV9GzZKEYLMZKj+tqVUwOfDFWhGwjE4 B7QgAKwHavpP9cWx9icsdhCfKbfcmW9oCG+KwcSgHLU3oreE+pPuFGbh4+PQjaBHhHiO oNgsowac2swWq9xbraTfIgeruDsq+em8J9OUI=
T (a,v) = apply(i->v[i+1],a)
a=[0,1,1,0,0,1]; v=[8,9]
w=T(a,v); print(w) \\ [8, 9, 9, 8, 8, 9]
S (a,v) = {my (t);
t(i)=v[i+1]; apply(t,a)}
w=S(a,v); print(w)
\\ (i)->my(a=[0, 1, 1, 0, 0, 1],v=[8, 9],t=0);v[i+1];apply(t,a)
S should do the same thing as T.
What is wrong? Is it possible to define an inner function t?
Thanks
Josef Eschgfaeller