#18052: Wrap Python functions in a PARI t_CLOSURE
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: positive_review
Priority: major | Milestone: sage-6.6
Component: interfaces | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers: Peter Bruin
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/wrap_python_functions_in_a_pari_entree_and_t_closure|
c14da15b4cd3c42e3d380edfc685d488ddfcd884
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by pbruin):
* status: needs_review => positive_review
* reviewer: => Peter Bruin
Comment:
This looks good to me now. We can always implement a variadic version
later, but I think is not a priority at the moment. Also, the most naïve
version of this makes the "cube" doctest fail, because even PARI doesn't
support variadic functions in `apply`:
{{{
gp> g(v[..]) = v[1]^3
%1 = (v[..])->v[1]^3
gp> g(2)
%2 = 8
gp> apply(g, [1,2,3])
*** at top-level: apply(g,[1,2,3])
*** ^----------------
*** apply: incorrect type in apply (t_CLOSURE).
}}}
(The error only arises because the closure is variadic; non-variadic
closures do work.)
--
Ticket URL: <http://trac.sagemath.org/ticket/18052#comment:12>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.