Ilya Zakharevich on Wed, 12 Mar 2003 10:12:50 -0800


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

Re: trap()ing user errors


On Wed, Mar 12, 2003 at 04:49:00PM +0100, Bill Allombert wrote:
> > What is lacking to trap, in my opinion:
> > 1) REC is not provided with error code/error message
> > 2) We cannot trap 'everything but that error'.
> > 3) No GP2C support.
> and 4) proper rewinding of local variables after an error.
> As such trap(,REC,) is dangerous to use:
> 
> parisize = 4000000, primelimit = 500000
> ? f(x)=local(V);V=x; error("Boum");
> ? V=2;
> ? trap(,1,f(3));
> ? print(V)
> 3

IMO, similar things should be done on the C side: prec,
seriesprecision, counts of temporary variables etc should be restored
by TRAP/etc.  At least one should have flavors of TRAP/etc which would
restore them.

Ilya