Bill Allombert on Fri, 13 Sep 2002 09:31:54 +0200

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

Re: error recovery (was Re: gp: series bug)

On Thu, Sep 12, 2002 at 08:50:15PM +0200, Karim BELABAS wrote:
> On Wed, 11 Sep 2002, Ilya Zakharevich wrote:
> > Yes, I think the second interface is much better (with minor changes...).
> So in fact, you'd completely remove the CATCH_ALL / numer parameter ?
> Hum. Any other opinion ?
> I've always wondered whether it is overkill to trap individual error types.
> Under GP, probably: using a global 'errno' (say a 'default') would simplify
> trap() semantics: 2 arguments only, and we wouldn't need to teach parierr.h
> to trap().

It's still remain three problems:

-- You still need a mechanism to match errno values with errors.
If errno is a string, you need a function to match it with the enum value.
If errno is an integer, then you are no more allowed to change the enum
value without breaking compatibility.

-- The current trap does not allows you to catch two different errors.

-- What code GP2C is supposed to generate ?

And anyway global values are evil. I would prefer trap use a &err to return the

default must stay defaults. That is parameters we use when nothing else is
specified. Then should always be overridable by wriing more precise code.
e.g. write 10+0E-28 if you do not want to depend on the realprecision default.
Using them as global variables is wrong, IMHO.