Jacques Gélinas on Mon, 25 Dec 2017 01:54:54 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
RE: Arity transfer from built-in function ?
|
- To: "pari-users@pari.math.u-bordeaux.fr" <pari-users@pari.math.u-bordeaux.fr>
- Subject: RE: Arity transfer from built-in function ?
- From: Jacques Gélinas <jacquesg00@hotmail.com>
- Date: Mon, 25 Dec 2017 00:54:45 +0000
- Accept-language: fr-CA, en-US
- Delivery-date: Mon, 25 Dec 2017 01:54:54 +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; bh=bqX8FKRqercmMUIN0xUcDTypG/nG5ORjOGcsy+oy8BI=; b=d9aKwciOg1vwGIm80JhjvDQFo45kVe3tyet98WesqAMD4o1DakR/Yqna3uBsz9kki6MI0JpMo0etbEm66IuFnc0/GW20XEvXO5/cH1/ocOVt42ZP4Gl60Bn/J8NswTLpfj8IKZndSaLC/j6JEOGqUMvScXBfyaQmH0QxRKWfTtP2HY0XKoDTt34381KkaJwXQVOIiaUYuzgV5ZcFWhT0RUk/OT4+7PdiTguGovpEP3o/xyE99TQlIXlgFoxebWr9lBLYYxKn5nSfUiVRPHHL2fWK+xSTFjxsb8khwzyhIdEx2dofIB3amh3PV5Tj/mZkbl/GEg/LRETKeMm37pRETg==
- In-reply-to: <20171224214628.GC15487@yellowpig>
- References: <DM5PR18MB1305DB550930FD8C4A87C969D2020@DM5PR18MB1305.namprd18.prod.outlook.com>,<20171224214628.GC15487@yellowpig>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
- Thread-index: AQHTe0FDaYdvOWOvOkiVomZPeLwMsKNTCssAgAAzKn0=
- Thread-topic: Arity transfer from built-in function ?
> different calling convention
Great explanation, thanks.
>The GP compiler generates code to convert between them when possible.
Yes, I noted that "vs=vecsum" does work.
Jacques Gélinas
===============================================================
On Fri, Dec 22, 2017 at 04:27:48PM +0000, Jacques Gélinas wrote:
> What is the t_CLOSURE assignment problem here ?
>
> # vc=vector;
> # vc(4,k,k)
> *** at top-level: vc(4,k,k)
> *** ^---------
> *** too many parameters in user-defined function call.
The first k is not a function parameter! So the arity is 2!
When you do 'vector', you are converting a builtin function to a
user function. Unfortunately user functions and builtin functions
have different calling convention. The GP compiler generates code
to convert between them when possible. Unfortunately some calling
conventions are unavailable in GP. This is the case here.
So the only thing that is supported is
vc(n)
Cheers,
Bill.