Bill Allombert on Fri, 22 Jun 2012 18:08:49 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Assigning closure names


On Fri, Jun 22, 2012 at 04:54:15PM +0200, Dirk Laurie wrote:
> Consider the following GP session.
> 
> ? type(Ser)
> %1 = "t_CLOSURE"
> ? type(Vec)
> %2 = "t_VEC"
> 
> Deduction: when a built-in function may be called
> with an empty parameter list, the bare name is
> interpreted as a function call, not as a reference
> to the closure.

Yes, this was done for backward compatibility.
Note that this is not really a reference to the closure:
instead this is a closure generated on the fly that mediate between 
user function calling convention and C function calling convention
and call the C function associated to Ser.

> Is there a way to access the closure "Vec" as
> a Pari object?

Not really. You can consider doing

? install("strtofunction",s)
? strtofunction("Vec")
%1 = Vec

Cheers,
Bill.