Bill Allombert on Mon, 19 Dec 2005 15:46:20 +0100


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

Re: A catch/throw mecanism with trap/error ?


On Sat, Dec 17, 2005 at 03:17:41PM +0100, ramare wrote:
> Dear all,
> 
>  Being a lisp addict, I like the catch and throw mecanism. This is
> exactly like the trap stuff except that what is trapped or caught
> is not an error. So it just occured to me that it should be possible
> to add, say 2/3 names of errors reserved for programming together
> with a throwerror function that would trigger it. Or make catch equal
> to trap and define throw.

You can throw error using error() already. This can be trapped with
trap("user",...).

If you read the bug report #329, you will see my proposal include

 6) Enhance error() so that it can take a errname() as input (so a user
 can forward error).

which would allow to have several class of user errors.

>  I'm not sure though that Bill will like my idea :-p

Why not ? The problem is to have a working and robust implementation,
something the lisp machine make easier to achieve than the C runtime.

Bill.