From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joo ChurlSoo Newsgroups: gmane.lisp.guile.user Subject: inconsistency between let and lambda Date: Fri, 14 Jan 2011 01:58:50 +0900 Message-ID: <87zkr4n3jp.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1294943565 13267 80.91.229.12 (13 Jan 2011 18:32:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 13 Jan 2011 18:32:45 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Jan 13 19:32:39 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PdRyR-00016F-2m for guile-user@m.gmane.org; Thu, 13 Jan 2011 19:32:39 +0100 Original-Received: from localhost ([127.0.0.1]:54172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdQhi-00054i-Ty for guile-user@m.gmane.org; Thu, 13 Jan 2011 12:11:19 -0500 Original-Received: from [140.186.70.92] (port=47073 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdQgn-0004aF-IZ for guile-user@gnu.org; Thu, 13 Jan 2011 12:10:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdQbl-0004S8-7x for guile-user@gnu.org; Thu, 13 Jan 2011 12:05:10 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:47878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdQbl-0004Rv-2D for guile-user@gnu.org; Thu, 13 Jan 2011 12:05:09 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PdQbg-000570-C8 for guile-user@gnu.org; Thu, 13 Jan 2011 18:05:04 +0100 Original-Received: from 203.130.105.213 ([203.130.105.213]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Jan 2011 18:05:04 +0100 Original-Received: from initerm by 203.130.105.213 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 13 Jan 2011 18:05:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 203.130.105.213 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:KppgBAYXcF2NYOsiwMzxNO6KL6w= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8362 Archived-At: The following behavior of `let' seems to be wrong. guile> (version) "1.8.8" guile> (let ((go #f) (alist '())) (let ((a 1) (b (call-with-current-continuation (lambda (x) (set! go x) 2)))) (set! alist (cons (cons a b) alist)) (set! a 100) (set! alist (cons (cons a b) alist)) (if (< (length alist) 3) (go 2) (reverse alist)))) ((1 . 2) (100 . 2) (100 . 2) (100 . 2)) guile>;; inconsistency between let and lambda (let ((go #f) (alist '())) ((lambda (a b) (set! alist (cons (cons a b) alist)) (set! a 100) (set! alist (cons (cons a b) alist)) (if (< (length alist) 3) (go 2) (reverse alist))) 1 (call-with-current-continuation (lambda (x) (set! go x) 2)))) ((1 . 2) (100 . 2) (1 . 2) (100 . 2)) guile> -- Joo ChurlSoo