Error policy (Was Re: [Maxima] proposal to modify op and args)
Subject: Error policy (Was Re: [Maxima] proposal to modify op and args)
From: Raymond Toy
Date: Tue, 09 May 2006 07:59:30 -0400
>>>>> "Robert" == Robert Dodier <robert.dodier at gmail.com> writes:
Robert> Hello Stavros,
>> In what cases do you think it would be helpful to the
>> user to define op(1) as false rather than an error?
Robert> As a general policy, I would like to see errors triggered in the
Robert> most limited circumstances possible. This is part of the still more
Robert> general policy, "Do not assume there is someone at the console".
Robert> Coming to a dead halt because the argument a in something like op(a) = "+"
Robert> is an atom is needlessly heavy-handed.
Actually, I rather like the policy of signaling errors. You get to
find out exactly where the error occurred instead of figuring out the
call tree to find that one function 20 calls deep that returned nil
instead of signaling an error.
And Maxima and Lisp have signal handlers so you can catch the error if
you really want or need to so you can do something sensible.
(Well, I don't really know how good Maxima's error handling is, but if
it's not good enough, it could be improved.)
Ray