behavior of 'taylor' when Taylor series is undefined



On 2012-12-21, Stavros Macrakis <macrakis at alum.mit.edu> wrote:

> Throwing an error seems like the right thing when the result is undefined
> (e.g. taylor of abs/signum).  For programmatic use, errcatch does pretty
> much the right thing (except that I don't know how you suppress printing an
> error message), and a textual error message plus the guilty argument are
> saved in 'error' (which is not ideal as a structured error message, but not
> too bad).
>
> Not sure what you mean by throwing a noun form; do you mean that 'error'
> should be set to [<error msg>,'taylor(abs(x),x,0,1)] instead of [<error
> msg>,abs(x)]?  That seems fine.

Well, what I meant is to execute throw('taylor(<bad args>)) or
throw('oops('taylor(<bad args>))) or something like that; triggering an
error seems heavy-handed, so I am hoping for finer-grained control over
the situation. I suppose I am mostly hankering for a system present in
some other programming languages which allow for hierarchically-defined
exception types and catching exceptions conditionally on type. I have
found such constructs to be an effective mechanism for non-local flow of
control. I haven't thought out what it would take to implement a similar
system in Maxima.

best

Robert Dodier