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 11:41:29 +0100 Message-ID: <7932480.qaFp3n8hK8@warperdoze> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit X-Trace: ger.gmane.org 1364035746 2455 80.91.229.3 (23 Mar 2013 10:49:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 23 Mar 2013 10:49:06 +0000 (UTC) To: 14039@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Mar 23 11:49:32 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 1UJM0y-0007z9-2E for guile-bugs@m.gmane.org; Sat, 23 Mar 2013 11:49:32 +0100 Original-Received: from localhost ([::1]:57997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0a-00088G-7c for guile-bugs@m.gmane.org; Sat, 23 Mar 2013 06:49:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0U-000831-J3 for bug-guile@gnu.org; Sat, 23 Mar 2013 06:49:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UJM0T-0005cy-Lz for bug-guile@gnu.org; Sat, 23 Mar 2013 06:49:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:37542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UJM0S-0005ct-V7 for bug-guile@gnu.org; Sat, 23 Mar 2013 06:49:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UJM2P-0006Ig-So for bug-guile@gnu.org; Sat, 23 Mar 2013 06:51:02 -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 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: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.136403585724204 (code B ref -1); Sat, 23 Mar 2013 10:51:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 23 Mar 2013 10:50:57 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) Original-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) User-Agent: KMail/4.9.5 (Linux/3.5.0-26-generic; KDE/4.9.5; x86_64; ; ) 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-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:6995 Archived-At: 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