From unknown Mon Aug 18 06:57:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14039: Bug in with-fluids semantics 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 10:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 14039 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 14039@debbugs.gnu.org X-Debbugs-Original-To: bug-guile@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.136403585724204 (code B ref -1); Sat, 23 Mar 2013 10:51:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Mar 2013 10:50:57 +0000 Received: from localhost ([127.0.0.1]:41651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJM2L-0006IK-2V for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:50:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56010) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJM2H-0006IB-9t for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJM0I-0005aQ-Hs for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:48:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0I-0005a7-EQ for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:48:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0H-0007zh-A9 for bug-guile@gnu.org; Sat, 23 Mar 2013 06:48:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJLtF-0004JR-SH for bug-guile@gnu.org; Sat, 23 Mar 2013 06:42:19 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:59452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLtF-0004Iz-IR for bug-guile@gnu.org; Sat, 23 Mar 2013 06:41:33 -0400 Received: by mail-la0-f44.google.com with SMTP id eb20so8794628lab.3 for ; Sat, 23 Mar 2013 03:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=mF8H2jwW1NQlzlkKjqjr7V+XyTovewGGy69RDJJktFM=; b=ad2OLET4G/CxNZtxkMP6TKCaY0pIjTZ5tIIM8LAFg+GYIAD2Zug9oUFNDtoFX20ZaH VxJBsO/wCh5DJIdan7WicZmMUlxwQLhG15ZXO8Srg7DNv3o2pVNFmQ6/W9nQGpPYYjjK 3BoR2Wg5uibM4vzNxR2PbSKcEaZm7iXTFNUv9eBDXJvzffer+w+aXpgqZJ1E28RsrKAY VE8jDxfAsR7POurDqiQ1WDiq4h/ub4Te5VY6mdZ4n1F9iPitrJoCGdyeD57a6qll0e71 AdHUh6QmhWTETjt53pC00V/zpZ4vgiAMPeZpy4RI4Ts7GKgsInABKICxWSrbTaiT8sqs LfIQ== X-Received: by 10.112.44.66 with SMTP id c2mr2687995lbm.69.1364035292355; Sat, 23 Mar 2013 03:41:32 -0700 (PDT) Received: from warperdoze.localnet (1-1-1-39a.veo.vs.bostream.se. [82.182.254.46]) by mx.google.com with ESMTPS id jh4sm2067351lab.7.2013.03.23.03.41.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Mar 2013 03:41:31 -0700 (PDT) From: Stefan Israelsson Tampe Date: Sat, 23 Mar 2013 11:41:29 +0100 Message-ID: <7932480.qaFp3n8hK8@warperdoze> User-Agent: KMail/4.9.5 (Linux/3.5.0-26-generic; KDE/4.9.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) 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 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. /Stefan From unknown Mon Aug 18 06:57:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14039: Bug in with-fluids semantics 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: To: Stefan Israelsson Tampe Cc: 14039@debbugs.gnu.org Received: via spool by 14039-submit@debbugs.gnu.org id=B14039.136405039217337 (code B ref 14039); Sat, 23 Mar 2013 14:54:02 +0000 Received: (at 14039) by debbugs.gnu.org; 23 Mar 2013 14:53:12 +0000 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 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 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== MIME-Version: 1.0 X-Received: by 10.50.135.105 with SMTP id pr9mr3749513igb.6.1364050265310; Sat, 23 Mar 2013 07:51:05 -0700 (PDT) Received: by 10.64.26.168 with HTTP; Sat, 23 Mar 2013 07:51:05 -0700 (PDT) In-Reply-To: <7932480.qaFp3n8hK8@warperdoze> References: <7932480.qaFp3n8hK8@warperdoze> Date: Sat, 23 Mar 2013 22:51:05 +0800 Message-ID: From: Daniel Hartwig Content-Type: text/plain; charset=UTF-8 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) 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? From unknown Mon Aug 18 06:57:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14039: Bug in with-fluids semantics 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: To: Daniel Hartwig Cc: 14039@debbugs.gnu.org Received: via spool by 14039-submit@debbugs.gnu.org id=B14039.136405340425140 (code B ref 14039); Sat, 23 Mar 2013 15:44:01 +0000 Received: (at 14039) by debbugs.gnu.org; 23 Mar 2013 15:43:24 +0000 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 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 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== MIME-Version: 1.0 X-Received: by 10.68.226.201 with SMTP id ru9mr8567544pbc.102.1364053275899; Sat, 23 Mar 2013 08:41:15 -0700 (PDT) Received: by 10.70.45.8 with HTTP; Sat, 23 Mar 2013 08:41:15 -0700 (PDT) In-Reply-To: References: <7932480.qaFp3n8hK8@warperdoze> Date: Sat, 23 Mar 2013 16:41:15 +0100 Message-ID: From: Stefan Israelsson Tampe Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) 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? From unknown Mon Aug 18 06:57:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14039: Bug in with-fluids semantics 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 18:01: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: To: Daniel Hartwig Cc: 14039@debbugs.gnu.org Received: via spool by 14039-submit@debbugs.gnu.org id=B14039.13640616125132 (code B ref 14039); Sat, 23 Mar 2013 18:01:02 +0000 Received: (at 14039) by debbugs.gnu.org; 23 Mar 2013 18:00:12 +0000 Received: from localhost ([127.0.0.1]:42484 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJSjk-0001Kj-5X for submit@debbugs.gnu.org; Sat, 23 Mar 2013 14:00:12 -0400 Received: from mail-pd0-f182.google.com ([209.85.192.182]:60197) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJSjh-0001Kb-Ns for 14039@debbugs.gnu.org; Sat, 23 Mar 2013 14:00:10 -0400 Received: by mail-pd0-f182.google.com with SMTP id y10so2025213pdj.27 for <14039@debbugs.gnu.org>; Sat, 23 Mar 2013 10:58:06 -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=62vtbcQu9ih3EsK9nLTZU4aL5nEZhRk/qQDKWmBLj/g=; b=fdUe+QgkbCN/S9TxEE2zDFy1YhEC75q6NEbwvHa4T38gnR6m42kqzkimcPD3hyPxtj f5Br9QcwWkQ2Vgsz12dFfVkkEZITN8xQzcZ61jDaxemdMvjjd8RwAjnn66wQ3U6hqCT8 Fviq3k0o2QzzNgqlYv2G/Bh3YZBByxbN5hOBzqdVT16uNHrr5mFvoDx3v0c+BRL3Z4oV +Tetu2R/BAa0vv7GrCb0ZlL5h9t2cL9ut1gxfDKTUZmFVdMaGXgdxIvSqA+p0Ao55usH FxTTe+zRhTrqF9Qf30Kme3iGjdAZL0n3M4Rw8I45ASfb0SSpZ59J0Gk8Z87viVCiQIxh /C8A== MIME-Version: 1.0 X-Received: by 10.66.221.226 with SMTP id qh2mr9592021pac.62.1364061486004; Sat, 23 Mar 2013 10:58:06 -0700 (PDT) Received: by 10.70.45.8 with HTTP; Sat, 23 Mar 2013 10:58:05 -0700 (PDT) In-Reply-To: References: <7932480.qaFp3n8hK8@warperdoze> Date: Sat, 23 Mar 2013 18:58:05 +0100 Message-ID: From: Stefan Israelsson Tampe Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Ok, I've been meditating over this question and really I can't find a single use case where the current behavior is prefered with an optimized path and the more natural behavior where undo and redo works is dismissed as a faulty semantics with a slow path. But not only this if my suggested change to the VM op semantics is implemented we could probably add a function via the C wrapper framework to to the other half of the swap in order to keep the current semantics. Then we can force those who uses this semantics to change there code to include the old behavior if they wish. Or we might take the defensive route to do the otehr way around. WDYT, can you find a use case where the current behavir is prefered? /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? From unknown Mon Aug 18 06:57:36 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Stefan Israelsson Tampe Subject: bug#14039: closed (Re: bug#14039: Bug in with-fluids semantics) Message-ID: References: <87obeaq6j0.fsf@pobox.com> <7932480.qaFp3n8hK8@warperdoze> X-Gnu-PR-Message: they-closed 14039 X-Gnu-PR-Package: guile Reply-To: 14039@debbugs.gnu.org Date: Sat, 23 Mar 2013 19:10:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1364065802-11220-1" This is a multi-part message in MIME format... ------------=_1364065802-11220-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #14039: Bug in with-fluids semantics which was filed against the guile package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 14039@debbugs.gnu.org. --=20 14039: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D14039 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1364065802-11220-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 14039-close) by debbugs.gnu.org; 23 Mar 2013 19:09:46 +0000 Received: from localhost ([127.0.0.1]:42510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJTp4-0002uU-0U for submit@debbugs.gnu.org; Sat, 23 Mar 2013 15:09:46 -0400 Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:33698 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJTp1-0002uM-Cn for 14039-close@debbugs.gnu.org; Sat, 23 Mar 2013 15:09:44 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id E58649EF5; Sat, 23 Mar 2013 15:07:38 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=6g8KL6Gz82qeYmzSQjcQIM91Ico=; b=pgfpXX xhWje35QfD2xfvWkhgoQqABVctbm30l2XyWstbi0lNRAGZtoCQNlRxnTW6Lt3+nh 48+5S1PM7cAQCJT/4zbt2aweaZk9WCEO+ab8FX30uEdaG/4DguKpTprFlxnp/plE 3XVkpC9fT2isEpaBQ2JWkdt7rhoYxY17k8jN0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=iVRww8bPDsH2b4RcBWMx7AeA3SWwemUg y36ohJjBjxeYnOLOYMcsnsXEXK2vFP7LO1DQw86JMDz60BmXcmdUYFncqRdptEGW rCXYC1yeFKGEl3K2y3BDtlpoQn7HH6SUHpqJncrQdeT6cLeCDRpgPFfLPuB01SmY +tXv6Jp8eE4= Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id DA9C19EF4; Sat, 23 Mar 2013 15:07:38 -0400 (EDT) Received: from badger (unknown [88.160.190.192]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 493829EF3; Sat, 23 Mar 2013 15:07:35 -0400 (EDT) From: Andy Wingo To: Stefan Israelsson Tampe Subject: Re: bug#14039: Bug in with-fluids semantics References: <7932480.qaFp3n8hK8@warperdoze> Date: Sat, 23 Mar 2013 20:07:31 +0100 In-Reply-To: <7932480.qaFp3n8hK8@warperdoze> (Stefan Israelsson Tampe's message of "Sat, 23 Mar 2013 11:41:29 +0100") Message-ID: <87obeaq6j0.fsf@pobox.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: EBF742A2-93EC-11E2-B84C-B7660E5B5709-02397024!a-pb-sasl-quonix.pobox.com X-Spam-Score: -2.5 (--) X-Debbugs-Envelope-To: 14039-close Cc: 14039-close@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.4 (----) On Sat 23 Mar 2013 11:41, Stefan Israelsson Tampe writes: > 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. That's not how fluids work, semantically: for better (I think) or for worse (you think). We cannot change this. A -- http://wingolog.org/ ------------=_1364065802-11220-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 23 Mar 2013 10:50:57 +0000 Received: from localhost ([127.0.0.1]:41651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJM2L-0006IK-2V for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:50:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56010) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJM2H-0006IB-9t for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:50:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJM0I-0005aQ-Hs for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:48:51 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,USER_IN_WHITELIST autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:39232) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0I-0005a7-EQ for submit@debbugs.gnu.org; Sat, 23 Mar 2013 06:48:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0H-0007zh-A9 for bug-guile@gnu.org; Sat, 23 Mar 2013 06:48:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJLtF-0004JR-SH for bug-guile@gnu.org; Sat, 23 Mar 2013 06:42:19 -0400 Received: from mail-la0-x22c.google.com ([2a00:1450:4010:c03::22c]:59452) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJLtF-0004Iz-IR for bug-guile@gnu.org; Sat, 23 Mar 2013 06:41:33 -0400 Received: by mail-la0-f44.google.com with SMTP id eb20so8794628lab.3 for ; Sat, 23 Mar 2013 03:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:subject:date:message-id:user-agent:mime-version :content-transfer-encoding:content-type; bh=mF8H2jwW1NQlzlkKjqjr7V+XyTovewGGy69RDJJktFM=; b=ad2OLET4G/CxNZtxkMP6TKCaY0pIjTZ5tIIM8LAFg+GYIAD2Zug9oUFNDtoFX20ZaH VxJBsO/wCh5DJIdan7WicZmMUlxwQLhG15ZXO8Srg7DNv3o2pVNFmQ6/W9nQGpPYYjjK 3BoR2Wg5uibM4vzNxR2PbSKcEaZm7iXTFNUv9eBDXJvzffer+w+aXpgqZJ1E28RsrKAY VE8jDxfAsR7POurDqiQ1WDiq4h/ub4Te5VY6mdZ4n1F9iPitrJoCGdyeD57a6qll0e71 AdHUh6QmhWTETjt53pC00V/zpZ4vgiAMPeZpy4RI4Ts7GKgsInABKICxWSrbTaiT8sqs LfIQ== X-Received: by 10.112.44.66 with SMTP id c2mr2687995lbm.69.1364035292355; Sat, 23 Mar 2013 03:41:32 -0700 (PDT) Received: from warperdoze.localnet (1-1-1-39a.veo.vs.bostream.se. [82.182.254.46]) by mx.google.com with ESMTPS id jh4sm2067351lab.7.2013.03.23.03.41.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 23 Mar 2013 03:41:31 -0700 (PDT) From: Stefan Israelsson Tampe To: bug-guile@gnu.org Subject: Bug in with-fluids semantics Date: Sat, 23 Mar 2013 11:41:29 +0100 Message-ID: <7932480.qaFp3n8hK8@warperdoze> User-Agent: KMail/4.9.5 (Linux/3.5.0-26-generic; KDE/4.9.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) 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 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. /Stefan ------------=_1364065802-11220-1-- From unknown Mon Aug 18 06:57:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14039: Bug in with-fluids semantics 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 19:47: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: To: Andy Wingo Cc: 14039-close@debbugs.gnu.org Received: via spool by 14039-done@debbugs.gnu.org id=D14039.136406799514367 (code D ref 14039); Sat, 23 Mar 2013 19:47:01 +0000 Received: (at 14039-close) by debbugs.gnu.org; 23 Mar 2013 19:46:35 +0000 Received: from localhost ([127.0.0.1]:42518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJUOf-0003jf-UD for submit@debbugs.gnu.org; Sat, 23 Mar 2013 15:46:34 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:36343) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJUOd-0003jW-8C for 14039-close@debbugs.gnu.org; Sat, 23 Mar 2013 15:46:32 -0400 Received: by mail-pa0-f43.google.com with SMTP id rl6so433776pac.16 for <14039-close@debbugs.gnu.org>; Sat, 23 Mar 2013 12:44:27 -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=K6xj2Z8Wp1c3ap/elIcrw4qkbj5wGS0GUq7D6DEdqyY=; b=fUPALhXyfEhxAQeK2elIZIJ/EnieXLjJbMaXNN6Jr/Y5ga3+WdIFPbcBpofh/5cb3V X/l2Ywjg1Lsf42XoLsocDJDugFENtduAtyY36M4et0MXEFEko9m3qHsK8IMUb6BqENM+ ZUVe51MdQGNUboOBkt2Xni5alRxoJvbNhMFgax5KmAcdp5bUh1VNihi8T2610y++ooea GFqUU8siJ9SicvV/MxKuoPgWqk8SNh29Nc1K09/WL9neLab+t+6+Muj+KI1zT3hP8g4E SfISlASHufF7YUZLK1mpPFeVNmUHLJC/sHtEE91JitOx/aAxWOZD5Qs9x+zfm3Zhbysa cfQQ== MIME-Version: 1.0 X-Received: by 10.68.24.33 with SMTP id r1mr9109971pbf.139.1364067866882; Sat, 23 Mar 2013 12:44:26 -0700 (PDT) Received: by 10.70.45.8 with HTTP; Sat, 23 Mar 2013 12:44:26 -0700 (PDT) In-Reply-To: <87obeaq6j0.fsf@pobox.com> References: <7932480.qaFp3n8hK8@warperdoze> <87obeaq6j0.fsf@pobox.com> Date: Sat, 23 Mar 2013 20:44:26 +0100 Message-ID: From: Stefan Israelsson Tampe Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Well yes you can actually. You can change and keep at the same time :-) I really agree that the current setup is what we got and may have merit but the problem is I have not find any uses of it. I would be glad to be wrong here but you all keep throwing a theoretical argument against it and just don't buy that until you can say that the semantic is good for this and that. On one side I may be ignorant and then please give me a hint so that I can learn. Or this is an indication of people being over theoretical in their argument. Both things can be right in my perspective so I'm not overly stupid being persistent for the good of the sake (Other than me might be glad to know about these matters) But the problem is not what we have. My problem is that what I can see as useful is not possible in an effective way. The basic problem is that a swap overwrites memory that could be kept. And I would prefer that we find a solution where both semantics can co-exists in an effective manner. So I would still consider it a BUG or at least a feature request. /Stefan On Sat, Mar 23, 2013 at 8:07 PM, Andy Wingo wrote: > On Sat 23 Mar 2013 11:41, Stefan Israelsson Tampe writes: > >> 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. > > That's not how fluids work, semantically: for better (I think) or for > worse (you think). We cannot change this. > > A > -- > http://wingolog.org/ From unknown Mon Aug 18 06:57:36 2025 X-Loop: help-debbugs@gnu.org Subject: bug#14039: Bug in with-fluids semantics Resent-From: Stefan Israelsson Tampe Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 24 Mar 2013 13:50: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: To: Andy Wingo Cc: 14039-close@debbugs.gnu.org Received: via spool by 14039-done@debbugs.gnu.org id=D14039.136413298824392 (code D ref 14039); Sun, 24 Mar 2013 13:50:02 +0000 Received: (at 14039-close) by debbugs.gnu.org; 24 Mar 2013 13:49:48 +0000 Received: from localhost ([127.0.0.1]:43123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJlIx-0006LN-4z for submit@debbugs.gnu.org; Sun, 24 Mar 2013 09:49:47 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:63517) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UJlIt-0006LE-Nk for 14039-close@debbugs.gnu.org; Sun, 24 Mar 2013 09:49:45 -0400 Received: by mail-pb0-f50.google.com with SMTP id up1so3745386pbc.37 for <14039-close@debbugs.gnu.org>; Sun, 24 Mar 2013 06:47:35 -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=t4H94ETEFxKaIIIKEUndZwMTyXACM4kQ+DQuHAnBLgU=; b=u0ibdPuYCttS3pyvBwZmU/4nSmtdMJe/U3ZHny1U0YOW4jTQXFHi98CS/7NpxAYl5n UC978dkixQO2g4NCldXj8fsGQeDC6vk5e38bkfAh7XZFvHz/1WJdpph1fw0jqEkm2epM 4oU0ihXI8Iozt5RfTJzIs65BcG/XvrQ9rNynqLXyHg/vuagNWSbQ4kNhFowSraA7kIe9 Urvh3IeHK/2oE+CdB73P45kFxsN389a+NzkWpfhOynAMwXkGARD6TP5zzjFnSf9uVqA0 TdegjFFeD6nW5gJ8ZwA9Ce+LaQwA/lYfGQAHjOK1N5qkrlHpLXRYoPvvwspct/6g/96h OoIQ== MIME-Version: 1.0 X-Received: by 10.68.242.65 with SMTP id wo1mr12470980pbc.62.1364132855114; Sun, 24 Mar 2013 06:47:35 -0700 (PDT) Received: by 10.70.45.8 with HTTP; Sun, 24 Mar 2013 06:47:35 -0700 (PDT) In-Reply-To: <87obeaq6j0.fsf@pobox.com> References: <7932480.qaFp3n8hK8@warperdoze> <87obeaq6j0.fsf@pobox.com> Date: Sun, 24 Mar 2013 14:47:35 +0100 Message-ID: From: Stefan Israelsson Tampe Content-Type: text/plain; charset=ISO-8859-1 X-Spam-Score: 0.1 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.6 (--) I got the impression (on irc) that you thought backtracking would be compromised with my fix. Not so. It's the other half of the swap that should be skiped. All semantics referring to situations where a continuation is used one or zero times is preserved. Consider a fluid a, with value v and storage s the swap used on wind and non local unwind and currently on return unwind ------------- temp <- v v <- s s <- temp Suggestion for the return unwind: v <- s E.g. we will backtrack to the old value before but not store the current value in s. It's true that the semantic is different. I would really say that we need to have both implemented. I would argue that my solution should be default. But I can live with it being a separate construct only that it will have support in the VM to get sane behavior in logic programs. /Stefan On Sat, Mar 23, 2013 at 8:07 PM, Andy Wingo wrote: > On Sat 23 Mar 2013 11:41, Stefan Israelsson Tampe writes: > >> 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. > > That's not how fluids work, semantically: for better (I think) or for > worse (you think). We cannot change this. > > A > -- > http://wingolog.org/