Jacques Gélinas on Mon, 25 Feb 2019 22:30:10 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
RE: Getting arity of closures
|
- To: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Subject: RE: Getting arity of closures
- From: Jacques Gélinas <jacquesg00@hotmail.com>
- Date: Mon, 25 Feb 2019 21:30:06 +0000
- Accept-language: fr-CA, en-US
- Delivery-date: Mon, 25 Feb 2019 22:30:10 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=urLKhOyEkW74t+WN1fizD3J8ZuQ/EuklFHlg+qbDtXk=; b=KRoyCdA2idkCGKuUNE3rHWUTlfXS+qYt6p0zW/MkY5LMvk23I0ClxcuTSSSPVGCpYhLcV3l2L8DhB17CA5w7luGXh0cl4O1ffdeI17xdBw7W5UfKA2Q+YzVOw4ADMi2htMAUCbvnRZdgSG+nhOrgx4tocCLjY6YUzafThInf8xvuCbrPzeHV9fDtFjHCnE79MRaC5lsojxhURmiyCcqr7Tpblh3uuTAK0bbetSIExqEeqKnORhkrY19I7fL6SKSlbDHJ0d6MtjbGpQhyugT4+78DalxqogtpOmTpw7RjB7yFFJEqV6C+I4RURmNako3BQT+NtL3V4OYTZCvjI3sK7w==
- In-reply-to: <7fbfe98a-4253-89e5-ec63-cc5a0708e5c0@brennen.net>
- References: <5C73FFAF.8080504@UGent.be>,<7fbfe98a-4253-89e5-ec63-cc5a0708e5c0@brennen.net>
- Thread-index: AQHUzRjasxHXUF/Su0iUVESgcpLznKXwo/KAgABhbNw=
- Thread-topic: Getting arity of closures
>It would seem to me that this should work:
> ? install("closure_arity","lG")
Nice solution, but does not work for some builtins.
vc = vector;
vc(1,k,k)
*** at top-level: vc(1,k,k)
*** ^---------
*** too many parameters in user-defined function call.
closure_arity(vc) == 2
alias(v,vector)
v(1,k,k) == [1]
closure_arity(v) == 2
\\ This was discussed in
\\ http://pari.math.u-bordeaux.fr/archives/pari-users-1712/msg00029.html
\\ What is the meaning of
closure_arity(anything) == 4612530443357519872
Jacques Gélinas