From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.bugs Subject: bug#14039: Bug in with-fluids semantics Date: Sat, 23 Mar 2013 22:51:05 +0800 Message-ID: References: <7932480.qaFp3n8hK8@warperdoze> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1364050325 28058 80.91.229.3 (23 Mar 2013 14:52:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 14:52:05 +0000 (UTC) Cc: 14039@debbugs.gnu.org To: Stefan Israelsson Tampe Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Mar 23 15:52:31 2013 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UJPo6-0000Rv-F0 for guile-bugs@m.gmane.org; Sat, 23 Mar 2013 15:52:30 +0100 Original-Received: from localhost ([::1]:34980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJPni-0004s9-J0 for guile-bugs@m.gmane.org; Sat, 23 Mar 2013 10:52:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJPnd-0004rt-FB for bug-guile@gnu.org; Sat, 23 Mar 2013 10:52:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJPnc-0006T5-FN for bug-guile@gnu.org; Sat, 23 Mar 2013 10:52:01 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJPnc-0006Sz-Ay for bug-guile@gnu.org; Sat, 23 Mar 2013 10:52:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UJPpa-0004Wh-2f for bug-guile@gnu.org; Sat, 23 Mar 2013 10:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Hartwig Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 23 Mar 2013 14:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14039 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 14039-submit@debbugs.gnu.org id=B14039.136405039217337 (code B ref 14039); Sat, 23 Mar 2013 14:54:02 +0000 Original-Received: (at 14039) by debbugs.gnu.org; 23 Mar 2013 14:53:12 +0000 Original-Received: from localhost ([127.0.0.1]:42335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJPom-0004Va-GR for submit@debbugs.gnu.org; Sat, 23 Mar 2013 10:53:12 -0400 Original-Received: from mail-ia0-f180.google.com ([209.85.210.180]:56276) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJPoi-0004VQ-Al for 14039@debbugs.gnu.org; Sat, 23 Mar 2013 10:53:09 -0400 Original-Received: by mail-ia0-f180.google.com with SMTP id f27so4299397iae.39 for <14039@debbugs.gnu.org>; Sat, 23 Mar 2013 07:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=xlobJMV0ZdjocPCXT7NpTvjrIW5OcHCd6NaocvNwjgA=; b=lIGLrqAJViLBDEIDmkFt+dC7DZWGKIjGmXt0ITWJypJHAKY1TDKTWHMbBc0I9qvqba GdvxVSegl4o5COsIWkC0GP/lUfsx+YvhUFDng7583eckaKLDpASA66p3vcg4+U34IcMq n2Vc3YEm3rJHFIVehvnrfrlDHdDwRZs5iZ50P0CL3Qku5yzk+7iw6+7R1Xoo9UKXHy4t VIG8tLOAtC8IJv6KXQl1q0jrwgIExHiwLMbzxqFiZpLcjAZmTchekeph29GZsugqXeX9 V30e6KUTLSxDAjOzFU8AE9LAw/yP5cKYnSZce4kT0LsmfaRKiC1xgUTZCHBE1bDSR5DH QiSw== X-Received: by 10.50.135.105 with SMTP id pr9mr3749513igb.6.1364050265310; Sat, 23 Mar 2013 07:51:05 -0700 (PDT) Original-Received: by 10.64.26.168 with HTTP; Sat, 23 Mar 2013 07:51:05 -0700 (PDT) In-Reply-To: <7932480.qaFp3n8hK8@warperdoze> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:6997 Archived-At: On 23 March 2013 18:41, Stefan Israelsson Tampe wrote: > Consider this simple exmple with fluids and reodos via propmts, > > (define (f x) > (let ((s (make-fluid 0))) > (with-fluids ((s 0)) > (let lp ((i 0)) > (cond ((>= i 100) (fluid-ref s)) > ((= i 50) (abort-to-prompt 'tag) (lp (+ i 1))) > (else (fluid-set! s (+ (fluid-ref s) i)) > (lp (+ i 1)))))))) > > (define k (call-with-prompt 'tag (lambda () (f 1)) (lambda (k . l) > k))) > > Then we will get in guile-2.0 pretty resent git version > scheme@(guile-user)> (k) > $1 = 4900 > scheme@(guile-user)> (k) > $2 = 8575 > What values do you expect from successive calls to K? > The reason is that when the with-fluid returns normally it does a full > swap. It should only do half a swap e.g. restore the old value of the > fluid and not store the current which is of non use because it can not > be reached anymore and it contaminates the continuation k. K captures S, a fluid, along with the dynamic extent. There is only a single dynamic extent to which K resumes, and only one value associated to the fluid S within that. Subsequent calls to K do not generate a new dynamic extent, so it makes sense that modifications to the fluids value persist. This example behaives as expected according to my understanding of fluids. Am I missing something?