guile-devel
[Top][All Lists]
Advanced

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

Re: scm_wrong_num_args


From: Miroslav Silovic
Subject: Re: scm_wrong_num_args
Date: 02 Apr 2001 14:58:18 +0200

Marius Vollmer <address@hidden> writes:

> "Dale P. Smith" <address@hidden> writes:
> 
> > Also, when an error occurs the ports are swapped back so that the
> > error handling function's input and output ports were at the time of
> > the load call, not at the time of the error.  I'm talking about the
> > handler you pass to gh_eval_file_with_catch.  There is no way (that
> > I know of) to recover the input port so you can find the line and
> > column number of the error.
> 
> Yes, more generally: in what context should error handlers execute?  I
> think they should execute in the dynamic context of the error (with
> the list of active handlers suitably adjusted).  However,
> `unwind-protect' handlers should be run in the dynamic context of the
> unwind-protect form.

Well, TOM has it solved (and the author claims he took the solution
from Common LISP, so CL conditions are certainly worth looking at). It
uses two separate constructs, one for handling the conditions, and the
other for unwinding the stack. Any exception is raised or signalled,
and a handler is invoked in the dynamic context of the error. For
signalled (this means non-critical) conditions, the handler may
return, in which case the execution continues. For raised conditions,
the handler must not returns, so it has to execute a throw.

-- 
How to eff the ineffable?



reply via email to

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