Re: Handling branch cuts for hypergeometric function s



> OK... But I suppose I still don't understand what "errorcode" is

Nothing, really, just pseudocode to indicate that we pass some information
to the hook function about the nature of the missing information.

> or what determines whether "...terminate or continue..." terminates
> or continues (and what continuing is in this context).

The return value of the hook function.


Anyway, I realized that, to a certain extent anyway, I was banging on open
doors. (That's what I get for jumping in on a discussion without doing my
homework first.) That is because it is already quite possible to override
functions like asksign1 or ask-integer and alter the behavior of programs
that rely on them. For example, if I wanted an error return instead of an
interactive query, I could do something like this:


(%i1) assume(a>2);
(%o1)                               [a > 2]
(%i2) integrate(x**a/(x+1)**(5/2), x, 0, inf);
    2 a + 2
Is  -------  an integer?
       5

y;
                               inf
                              /         a
                              [        x
(%o2)                         I    ---------- dx
                              ]           5/2
                              /    (x + 1)
                               0
(%i3) to_lisp();

Type (to-maxima) to restart

MAXIMA> (defun ask-integer (exp even-odd) (merror "Don't know if ~M is
integer" exp))
ASK-INTEGER
MAXIMA> (to-maxima)
Returning to Maxima
(%o3)                                true
(%i4) integrate(x**a/(x+1)**(5/2), x, 0, inf);

              2 (a + 1)
Don't know if --------- is integer
                  5
 -- an error.  Quitting.  To debug this try debugmode(true);


This "solution" is far from perfect, since a "proper" override would have to
replicate many lines of code from asksign1, ask-integer, and possibly other
functions, but it demonstrates how we could make this happen. (I continue to
be amazed by the flexibility of the Maxima architecture. If only I could
find a way to represent differential operators! But that's another story.)


Viktor