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: David Kastrup
Subject: Re: Anything better for delayed lexical evaluation than (lambda () ...)?
Date: Tue, 06 Dec 2011 16:45:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Thien-Thi Nguyen <address@hidden> writes:

> () David Kastrup <address@hidden>
> () Sat, 03 Dec 2011 16:45:06 +0100
>
>    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?
>
> Does ‘delay’ (and later ‘force’) work?

No.
(set! (force (delay (some-procedure-with-setter and its args))))
does not work.

In addition, each expression will be run once or not at all (and its
side effects on the containing environment are desired), so the
memoizing nature of promises does not help.

-- 
David Kastrup




reply via email to

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