guile-devel
[Top][All Lists]
Advanced

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

Re: Use of continuations in eval traps


From: Mikael Djurfeldt
Subject: Re: Use of continuations in eval traps
Date: Fri, 28 Oct 2005 22:54:08 +0200

On 10/28/05, Neil Jerram <address@hidden> wrote:
> I'm writing directly to you (CC guile-devel) because I believe you
> originally implemented the low level traps in eval.c - please correct
> me if that's wrong.

No, that's right.

> I'm thinking about how to implement the ability to skip over the
> evaluation of an expression, and providing an easy interface for use
> in my Emacs front end, and wondering whether the existing
> continuation-based approach is really needed.  The problem with the
> continuation approach (in other words, whenever the 'cheaptraps option
> is off) is that a continuation is set up before every trap call even
> though it won't be needed in most cases, and it seems to me that one
> could get similar function by passing the expression to evaluate into
> the trap handler and allowing the trap handler to modify it (either by
> side effect or by return, to be determined).
>
> If I'm right, it also follows that we could remove the 'cheaptraps
> option and use debug-objects unconditionally for these trap calls.
> Note that the trap handler remains free to save off its continuation
> itself, if that is useful.
>
> What do you think?

You are probably more competent to answer the question than me.

I wrote that code when I was pretty inexperienced, and the choice to
allow for the continuation to be saved was probably more motivated by
a feeling that I didn't want any limitations on what you could do with
traps than anything more specific---except that I probably had
imagined the continuations as a way to resume execution after a
breakpoint, of course.

I agree that it seems expensive to create the continuation at every
trap, and your idea to skip the cheaptraps option and delegate the
decision whether to create the continuation or not to the lazy handler
code (I assume) seems good.

Unfortunately I can't say anything more constructive than that because
I'm not up-to-date with the code.

BTW, your work on the debugger and Emacs interface seems really great---thanks!

M




reply via email to

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