guile-devel
[Top][All Lists]
Advanced

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

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


From: David Kastrup
Subject: Anything better for delayed lexical evaluation than (lambda () ...)?
Date: Sat, 03 Dec 2011 16:45:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Hi, if I have something read that is evaluated later, the lack of
procedure-environment in Guilev2 implies that I have to wrap the stuff
in (lambda () ...) in order to capture the lexical environment for
evaluation.

Is it possible to have a shortcut (make-closure ...) or so for that
purpose?  The reason is that if ... is a call to a
procedure-with-setter, (lambda () ...) actually does not cut it for
capturing the semantics of ..., and I need
(make-procedure-with-setter (lambda () ...)
                            (lambda (x) (set! ... x)))

But x is not hygienic, so this is again too simplistic.  And a separate
macro make-closure also could decide that the expression is pure anyway
and not go to the pain of creating an actual closure.

In any way, using (lambda () ...) might have more cases where it just is
not equivalent to the lexical expression inside when macros come into
play.

-- 
David Kastrup




reply via email to

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