Re: Handling branch cuts for hypergeometric function s
Subject: Re: Handling branch cuts for hypergeometric function s
From: Richard Fateman
Date: Wed, 16 Feb 2005 07:27:27 -0800
There are other ways of altering the
ask-integer program by hacking lisp, but only temporarily.
You can save the old definition and restore it.
e.g. (setf oldfunction (symbol-function 'ask-integer))..
....
(setf (symbol-function 'ask-integer )oldfunction)
Or (not in Common Lisp, just Scheme) re-bind the
function definition locally.
Or you can use (in some CL systems) an "advise" function
that says something like
when inside this function change ask-integer to ..... else use
the old definition.
Allegro Common Lisp has this, but also something more general called
fwrapper.
It might also be possible to use object-oriented programming
with inheritance to do something here. I usually think in terms
of functions, however.
Otherwise, trying to make ask- smarter seems like a good idea.
RJF
Viktor T. Toth wrote:
.....
>
> What I am suggesting is a formalized hook function that would be called
> before an ask... function resorts to an interactive query. Something like
> this (please don't take it too literally, this is just pseudocode):
>
> function ask_pred(expression)
> if (pred can be evaluated) return result;
> + if (hook_pred is defined)
> + hook_pred(expression);
> + if (pred can now be evaluated) return result;
> + endif
> query the user;
> return result;
> end function
>
> It is the lines I marked with plus signs that are "new" in the sense that
> they'd have to be added to the existing definitions of the predicate query
> functions if we choose to go in this direction.
>
>
> Viktor
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima