From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: inconsistency between let and lambda Date: Sat, 15 Jan 2011 20:42:25 +0000 Message-ID: <87hbd9gaq6.fsf@ossau.uklinux.net> References: <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 1295124254 31476 80.91.229.12 (15 Jan 2011 20:44:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 Jan 2011 20:44:14 +0000 (UTC) Cc: guile-user@gnu.org To: Joo ChurlSoo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jan 15 21:44:10 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 1PeCyl-00087L-Ik for guile-user@m.gmane.org; Sat, 15 Jan 2011 21:44:07 +0100 Original-Received: from localhost ([127.0.0.1]:37826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeCxN-00018r-VC for guile-user@m.gmane.org; Sat, 15 Jan 2011 15:42:42 -0500 Original-Received: from [140.186.70.92] (port=55414 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeCxA-00018c-IL for guile-user@gnu.org; Sat, 15 Jan 2011 15:42:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeCx9-0008HH-9G for guile-user@gnu.org; Sat, 15 Jan 2011 15:42:28 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:50202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeCx9-0008HD-3U for guile-user@gnu.org; Sat, 15 Jan 2011 15:42:27 -0500 Original-Received: from arudy (unknown [78.149.119.15]) by mail3.uklinux.net (Postfix) with ESMTP id A52C21F66C8; Sat, 15 Jan 2011 20:42:26 +0000 (GMT) Original-Received: from neil-laptop (unknown [192.168.11.3]) by arudy (Postfix) with ESMTP id 20C263801E; Sat, 15 Jan 2011 20:42:26 +0000 (GMT) In-Reply-To: <87zkr4n3jp.fsf@gmail.com> (Joo ChurlSoo's message of "Fri, 14 Jan 2011 01:58:50 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:8366 Archived-At: Joo ChurlSoo writes: > 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> For what it's worth, my current Guile, from Git post 1.9.14, gives ((1 . 2) (100 . 2) (1 . 2) (100 . 2)) for both cases. Neil