Re: Handling branch cuts for hypergeometric function s
Subject: Re: Handling branch cuts for hypergeometric function s
From: Raymond Toy
Date: Mon, 14 Feb 2005 16:08:55 -0500
>>>>> "Viktor" == Viktor T Toth writes:
>> Well, I would consider that an error in your program, if it needs
>> to know the sign of X and doesn't
Viktor> I think you miss the point here. My program doesn't need
Viktor> to know the sign of X. It is a subprogram that my program
Viktor> calls that needs to know the sign of X. In order for my
Viktor> program to know that it requires knowledge of the sign of
Viktor> X, it has to possess knowledge of the _internal workings_
Viktor> of the subprogram, and every other subprogram that that
Viktor> subprogram calls upon.
Viktor> In other words, it is one thing to properly respond to
Viktor> error codes returned by a subroutine, it's another thing
Viktor> altogether to _predict_ the behavior of the subroutine,
Viktor> and avoid calling it with parameters that'd trigger
Viktor> interactive behavior.
I think having maxima (lisp) signal a continuable error solves all of
these issues. If your program doesn't want to deal with these issues,
it installs a handler so that when such a signal occurs, it handles it
and does whatever it thinks is appropriate. For everyone else, you
get a query about what to do. If we wanted to get fancy, we could
even install a default handler to abort if there's no interactive
stream to prompt for the answers.
Returning error codes is a mistake, in my opinion.
Ray