#14894: Fix PARI error handling (needed for future upgrade to PARI 2.6)
--------------------------------------+-------------------------------
Reporter: vbraun | Owner: jdemeyer
Type: defect | Status: needs_review
Priority: major | Milestone: sage-5.12
Component: packages: standard | Resolution:
Keywords: pari error signal | Merged in:
Authors: Peter Bruin | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Dependencies: #12142, #14873
Stopgaps: |
--------------------------------------+-------------------------------
Comment (by pbruin):
Replying to [comment:13 jdemeyer]:
> Also, I really don't like that `sage_pari_catch()` and
`sage_pari_catch_end()` contain complementaty braces. I would strongly
recommend to try to keep the following working as before:
> {{{
> sage_pari_catch()
> return new_gen(something returning GEN)
> }}}
I see that this would be desirable because it saves typing a few lines
each time. On the other hand, I think the above code is bad style because
it explicity begins a block, but implicity ends it. The fact that the
macros contain complementary braces makes them less flexible, but make it
clearer where the error-catching block ends.
Actually, as far as I'm concerned it would be even nicer if we could have
the `with` syntax as in my previous comment. This would force us at the
same time to avoid complementary braces, which can be a good thing or not
(we seem to disagree on this). However, there are two real disadvantages
to this approach:
- it won't translate into simple C code and will certainly be slower;
- we cannot use the macros that PARI provides, and instead hack something
ourselves that uses `alloca()`, `malloc()` or a global variable to
allocate the `jmp_buf` (stack environment for use with `sigjmp()`);
otherwise it will disappear from the scope. This is exactly the problem
that this ticket tries to solve.
--
Ticket URL: <http://trac.sagemath.org/ticket/14894#comment:16>
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/groups/opt_out.