Bill Allombert on Mon, 21 Sep 2009 00:53:16 +0200


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

Re: TRY/CATCH is unnecessarily slow on OS X


On Thu, Sep 10, 2009 at 08:32:28AM +0200, Lorenz Minder wrote:
> Hi,
> 
> > err_catch only purpose is to implement the current stacked exceptions 
> > system which I find wholly inedequate and hope to replace.
> > 
> > Furthermore, TRY/CATCH is not documented currently,
> 
> While this is correct, no other error handling mechanism was documented
> either.  Yet, any nontrivial program needs to handle errors.
> 
> >and mostly here 
> > to implement the gp trap() function, which has its load of problem.
> 
> I see.  Are the problems in trap() related to CATCH/TRY itself?
> 
> > Adding a call-back 'cb_pari_err_restore' seems a better solution.
> 
> I think that would be a workable solution, too.

OK, I have just commited my patches. There are still lot of changes to
do.

This is an example of the new debugger interface:

? intnum(x=-1,1,1/x)
  ***   at top-level: intnum(x=-1,1,1/x)
  ***                                ^---
  *** _/_: division by zero
  ***   Break loop: type <Return> three times, or Control-d, to go back to GP)
break> x
0.E-57
break> 1/0
  ***   at top-level: intnum(x=-1,1,1/x)
  ***                                ^---
  ***   in anonymous function: 1/0
  ***                           ^--
  *** _/_: division by zero
  ***   Break loop: type <Return> three times, or Control-d, to go back to GP)
break[2]>

  ***   at top-level: intnum(x=-1,1,1/x)
  ***                                ^---
break>


Cheers,
Bill.