From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.bugs Subject: bug#14039: Bug in with-fluids semantics Date: Sat, 23 Mar 2013 16:41:15 +0100 Message-ID: References: <7932480.qaFp3n8hK8@warperdoze> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1364053328 21559 80.91.229.3 (23 Mar 2013 15:42:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 15:42:08 +0000 (UTC) Cc: 14039@debbugs.gnu.org To: Daniel Hartwig Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Mar 23 16:42:30 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 1UJQaS-0004n2-4O for guile-bugs@m.gmane.org; Sat, 23 Mar 2013 16:42:28 +0100 Original-Received: from localhost ([::1]:49068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJQa4-0003KD-I8 for guile-bugs@m.gmane.org; Sat, 23 Mar 2013 11:42:04 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJQa0-0003K8-RQ for bug-guile@gnu.org; Sat, 23 Mar 2013 11:42:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJQZz-0005sZ-PB for bug-guile@gnu.org; Sat, 23 Mar 2013 11:42:00 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38260) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJQZz-0005sV-Lm for bug-guile@gnu.org; Sat, 23 Mar 2013 11:41:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UJQbx-0006YP-Rm for bug-guile@gnu.org; Sat, 23 Mar 2013 11:44:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Israelsson Tampe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 23 Mar 2013 15:44:01 +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.136405340425140 (code B ref 14039); Sat, 23 Mar 2013 15:44:01 +0000 Original-Received: (at 14039) by debbugs.gnu.org; 23 Mar 2013 15:43:24 +0000 Original-Received: from localhost ([127.0.0.1]:42369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJQbL-0006XQ-DM for submit@debbugs.gnu.org; Sat, 23 Mar 2013 11:43:24 -0400 Original-Received: from mail-da0-f44.google.com ([209.85.210.44]:64238) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJQbH-0006XH-D6 for 14039@debbugs.gnu.org; Sat, 23 Mar 2013 11:43:22 -0400 Original-Received: by mail-da0-f44.google.com with SMTP id z20so2640431dae.17 for <14039@debbugs.gnu.org>; Sat, 23 Mar 2013 08:41:16 -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=tL2DE298szdwcZh60SEuWsiEb632fyG4Hys3WEGF/zs=; b=H7upKX5PBP36BvVhdKHIROib9CLc+j0JIqGIWnRWnh41FuB+NTNcNnUlKx9U9XGyqN ZS56z28XZBuNG7mncK8HTEOIT5kRECBiENNR+EoAb8BkWDb9VMhVaCtJmDCFNardY4kA 7P047nSMAZhraVn64WQrdVZwWpe1Xz1AYlBO+B+t9AQJr7xbMOEjS182rMM2sYmN3jiv Jc0cBrYW0bA9wzUmoblEWdX3SvARYbKhLlRiVziRbGrSoiULYz841ZnqfyDyRNyZRE8S 7NPnDGkbXr0AyLkALnOyQWo4aC/DCrZQNAcfRHjW00UTdJyDuD6TaGdIJAFvei1w2nob 9AYQ== X-Received: by 10.68.226.201 with SMTP id ru9mr8567544pbc.102.1364053275899; Sat, 23 Mar 2013 08:41:15 -0700 (PDT) Original-Received: by 10.70.45.8 with HTTP; Sat, 23 Mar 2013 08:41:15 -0700 (PDT) In-Reply-To: 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:6998 Archived-At: I would expect (k) to be the same. Otherwise fluids would not mix well with undo redo sematics. But I do understand that people might have decided that it should work like this. and knowing the this semantic, one can fix the problem. If the semantics is correct I really can't find an example where it is useful though. Do you have an example? /Stefan On Sat, Mar 23, 2013 at 3:51 PM, Daniel Hartwig wrote: > 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?