guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Divide by zero or how to overload a function


From: Brett Viren
Subject: Re: Divide by zero or how to overload a function
Date: Mon, 22 Oct 2001 15:01:12 -0400

Keith Wright writes:
 > The users are just a little confused.  The proper thing to do is to
 > catch the error just before plotting, and plot a vertical line.

This would also be okay, and even a preferable solution, but how?
Currently I evaluate the user functions via this method:

SCM EOS::Guile::EvalCatch(SCM& proc) 
{ 
    return scm_catch(SCM_BOOL_T, proc, fErrorHandlerProc); 
} 

where:

fErrorHandlerProc = gh_eval_str("(lambda (key . args) "
    "(display (list \"Error in proc:\" key \" args: \" args)) (newline))"); 

Maybe this isn't the best way to do things, but how might I catch just
divide-by-zero in order to plot the vertical line but have all other
errors handled with this generical warning?

-Brett.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]