guile-devel
[Top][All Lists]
Advanced

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

Re: Anything better for delayed lexical evaluation than (lambda () ...)?


From: Mark H Weaver
Subject: Re: Anything better for delayed lexical evaluation than (lambda () ...)?
Date: Wed, 14 Dec 2011 16:03:37 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)

Hi Noah,

Noah Lavine <address@hidden> writes:
> Perhaps this is obvious to everyone else, but it just occurred to me
> that (capture-local-environment) is just
> (call-with-current-continuation), but running in the environment of
> the evaluator instead of the program being evaluated. It's as though
> the evaluator was going to look in a tree for more code, but hit a
> special node and did a (call/cc). I hope other people find this
> interesting.

Ah yes, that's an excellent point!

In fact it makes me wonder whether `the-environment' and `local-eval'
could actually be implemented this way.  I see some complications that
might make this strategy impractical or fragile, most notably that we
must be assured that the (call/cc) does not happen until
(the-environment) would have been _evaluated_, whereas the
expander/memoizer/evaluator will want to see what code is there _before_
evaluation.  I'll have to think about this.  There might be an easy and
robust way to do this, or maybe not.

Regardless, this is a great way to _think_ about these primitives in
terms that Schemers can understand, and maybe a selling point too.  I
hope we can agree that first-class continuations are insanely great.
They carry a significant maintenance cost, but they also add great power
when they are needed.  So why not first-class continuations for the
evaluator itself? :)

     Thanks!
       Mark



reply via email to

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