Dirk Laurie on Wed, 20 Jun 2012 06:27:41 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: gp_read_str |
2012/6/15 Bill Allombert <Bill.Allombert@math.u-bordeaux1.fr>: > Mayeb there are nicer ways to do that with PARI 2.5. > For example you do > GEN code = gp_read_str("(a,b,c)->a*(b-c)"); > and then > GEN res = closure_callgenvec(code, mkvec3(a,b,c)) > Thanks, that solves my problem completely. Two more questions, though. 1. Maybe in view of the usefulness of the above suggestion the statement below is a little too discouraging, especially since Â11.1 documents closure_callgenvec and some other functions too. 4.5.19 Type t_CLOSURE (closure).: This type hold GP functions and closures, in compiled form. It is useless in library mode and subject to change each time the GP language evolves. Hence we do not describe it here and refer to the Developer's Guide. 2. Is there a way to find out the arity of the closure before calling it? Even better, to have access to the entree of the closure? merci, Dirk