Re: Handling branch cuts for hypergeometric function s



>>>>> "Viktor" == Viktor T Toth  writes:

    Viktor> 1.  (*) text/plain          ( ) text/html           
    >> Sorry, I'm at work, and not at home, and I didn't see it on the
    >> mailing list, so I assumed you wanted to keep it private.

    Viktor> I made the same assumption when I wrote it, since it was
    Viktor> in response to a message from you that was sent only to
    Viktor> me, not the list.

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

    >> But Lisp is both an interactive system and a programming language.
    >> This distinction isn't made, and I think it works well

    Viktor> But Maxima isn't LISP. Its syntax is much more that of a procedural
    Viktor> language, and what works in LISP may not work in Maxima.

I don't see how procedural language fits into the picture.  I find
maxima is as procedural as Lisp.  But I agree that what works in Lisp
may not be the right answer for Maxima.  

    Viktor> From a programming perspective, I don't see it working
    Viktor> "well" at all when a supposedly non-interactive program
    Viktor> hangs because Maxima stupidly waits for a non-existent
    Viktor> user to tell it if X is positive or negative. IMO, it is
    Viktor> at least as annoying (if not more so) than your example of
    Viktor> having to reenter a calculation because it failed for lack
    Viktor> of an ASSUME().

Well, I would consider that an error in your program, if it needs to
know the sign of X and doesn't.  What should it do?  Stop?  Waiting
for a non-existent user to answer is as good as stopping.

    >> If I make an error at the prompt, I want my program that makes
    >> the same error to behave the same way.

    Viktor> But in many cases, what happens is not
    Viktor> predictable. Whoever writes the program may have no way of
    Viktor> knowing what data is thrown at it. The data a function
    Viktor> processes may contain references to expressions that
    Viktor> trigger the "interactive query" behavior in a totally
    Viktor> inappropriate context, when it'd be much preferable, for
    Viktor> instance, for the function to just return an error code.

Garbage in, garbage out. :-)

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.
By default, maxima already just returns to the prompt when an error
happens.  Passing error codes around just complicates everyone's life,
because it forces every single function to be able to handle it in
some way.  Throwing an error is much cleaner.

This also makes debugging much harder.  Someone, somewhere has
returned an error code.  Now what?  Finding out who did it is now
going to be hard.  An error could at least get me to the Lisp debugger
so I can find out exactly what happened, and how.

    Viktor> But hey, I have a proposal: let's get rid of both global
    Viktor> flags AND interactive queries! 

Yes!  Well, No!.  Er, maybe. :-)

Ray