From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Anything better for delayed lexical evaluation than (lambda () ...)? Date: Sat, 03 Dec 2011 16:45:06 +0100 Organization: Organization?!? Message-ID: <87liqtpsl9.fsf@fencepost.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1322927421 14052 80.91.229.12 (3 Dec 2011 15:50:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 3 Dec 2011 15:50:21 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 03 16:50:17 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RWrqz-0001Y3-AQ for guile-devel@m.gmane.org; Sat, 03 Dec 2011 16:50:17 +0100 Original-Received: from localhost ([::1]:58268 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWrqy-0005eu-Kt for guile-devel@m.gmane.org; Sat, 03 Dec 2011 10:50:16 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:47855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWrqw-0005ep-LF for guile-devel@gnu.org; Sat, 03 Dec 2011 10:50:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RWrqv-0003ha-KN for guile-devel@gnu.org; Sat, 03 Dec 2011 10:50:14 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:43000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RWrqu-0003hU-SE for guile-devel@gnu.org; Sat, 03 Dec 2011 10:50:13 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RWrqt-0001Vn-8p for guile-devel@gnu.org; Sat, 03 Dec 2011 16:50:11 +0100 Original-Received: from p508edaa1.dip.t-dialin.net ([80.142.218.161]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Dec 2011 16:50:11 +0100 Original-Received: from dak by p508edaa1.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 03 Dec 2011 16:50:11 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508edaa1.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) Cancel-Lock: sha1:eBNcyZbPa5k1eNmHOtiO8gCAGeI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12955 Archived-At: 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