Re: Handling branch cuts for hypergeometric function s



> Ah, sorry, I typically respond to all, but maybe I should only
> respond to the mailing list (as I'm doing now).

OK, same here.

> Well, I would consider that an error in your program, if it needs
> to know the sign of X and doesn't

I think you miss the point here. My program doesn't need to know the sign of
X. It is a subprogram that my program calls that needs to know the sign of
X. In order for my program to know that it requires knowledge of the sign of
X, it has to possess knowledge of the _internal workings_ of the subprogram,
and every other subprogram that that subprogram calls upon.

In other words, it is one thing to properly respond to error codes returned
by a subroutine, it's another thing altogether to _predict_ the behavior of
the subroutine, and avoid calling it with parameters that'd trigger
interactive behavior.

In some cases, this'd not only mean that the calling program has to possess
knowledge of the internal workings of the subprogram, but also that it has
to parse its parameters (which can be complicated expressions) in order to
find out if they may contain symbols or subexpressions that may trigger
undesirable behavior in the subprogram.

> Waiting for a non-existent user to answer is as good as stopping.

That's probably true, which is why it'd be much preferable to return an
error code, and leave it to the calling program to decide what to do with it
(in particular, whether or not to present a user interface to resolve the
problem.)

> I don't see how an error code solves anything.  I'd rather just have
> an error and die.  At least you then know something bad happened.

What you want to do with the code is your preference. If you prefer to let
it die, let it die. The point is, by returning an error code, we give the
programmer of the calling program the OPTION to handle the error in a manner
they find preferable, instead of barfing up a query on the screen.

> This also makes debugging much harder.  Someone, somewhere has
> returned an error code.  Now what?

Well, we could have a global flag to control whether error codes are
returned or not 

Or perhaps something else altogether, but I fear I may be venturing into
La-La land now: perhaps instead of error codes, we should add an exception
mechanism to Maxima? (OK, you can stop kicking me now. After all, even BASIC
has ON ERROR GOTO...)


Viktor