From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.bugs Subject: bug#14347: reset, shift, continuation values truncated inconsistently Date: Mon, 06 May 2013 20:06:30 +0100 Message-ID: <8761ywexmx.fsf@Kagami.home> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1367867231 32480 80.91.229.3 (6 May 2013 19:07:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 6 May 2013 19:07:11 +0000 (UTC) Cc: 14347@debbugs.gnu.org To: Jussi Piitulainen Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon May 06 21:07:11 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 1UZQkg-0007Lp-CE for guile-bugs@m.gmane.org; Mon, 06 May 2013 21:07:10 +0200 Original-Received: from localhost ([::1]:35174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZQkf-0002UI-Jb for guile-bugs@m.gmane.org; Mon, 06 May 2013 15:07:09 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:46393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZQka-0002Pz-Vw for bug-guile@gnu.org; Mon, 06 May 2013 15:07:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZQkZ-0006cy-MI for bug-guile@gnu.org; Mon, 06 May 2013 15:07:04 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56049) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZQkZ-0006ct-HQ for bug-guile@gnu.org; Mon, 06 May 2013 15:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UZQlV-0005Yj-HV for bug-guile@gnu.org; Mon, 06 May 2013 15:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ian Price Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 06 May 2013 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 14347 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 14347-submit@debbugs.gnu.org id=B14347.136786725821319 (code B ref 14347); Mon, 06 May 2013 19:08:01 +0000 Original-Received: (at 14347) by debbugs.gnu.org; 6 May 2013 19:07:38 +0000 Original-Received: from localhost ([127.0.0.1]:60158 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZQl7-0005Xn-Tr for submit@debbugs.gnu.org; Mon, 06 May 2013 15:07:38 -0400 Original-Received: from mail-wg0-f51.google.com ([74.125.82.51]:63141) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UZQl5-0005XY-Fz for 14347@debbugs.gnu.org; Mon, 06 May 2013 15:07:36 -0400 Original-Received: by mail-wg0-f51.google.com with SMTP id b13so3786400wgh.6 for <14347@debbugs.gnu.org>; Mon, 06 May 2013 12:06:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=sMSDWsXRKoe0OT/hZUwcZxQo9Vx5HxKIUjqFXBfSms0=; b=VLXon3HWCLw+/FMz3R8UGoyRBAz+xzaFHKSwPXmxLCUjvECLoKeOpbgAI5nd0HY8rS TJBUSVasXTRTEOyJ9OGmwJC/hPH05I9XdT84Ouu5T9ufbk/BZy/hDrm2EMOUQ9eQ6zR/ yfE8mdatM+0K9HQRI7VbpWJMiS90nPzLDfYnJ9YHREIdgk5sNQbmPq7NHe9CDiwkI2Tj c7H5fptgF4CACS5BJt+Nja7r3eY5VOzgiHTCXO2aEBzJ/9giRMeEuhK/bdRlsH7Uglnm IPR6s7UOZ5sibMKZLSLvn1uUZxqovJbmxq7CmLI/N5suNjYkEcFjND2/LJPuCzg+ddRW MCcw== X-Received: by 10.194.104.102 with SMTP id gd6mr13732848wjb.48.1367867196436; Mon, 06 May 2013 12:06:36 -0700 (PDT) Original-Received: from Kagami.home (host81-155-30-39.range81-155.btcentralplus.com. [81.155.30.39]) by mx.google.com with ESMTPSA id er17sm15951256wic.0.2013.05.06.12.06.33 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 06 May 2013 12:06:34 -0700 (PDT) In-Reply-To: (Jussi Piitulainen's message of "04 May 2013 10:47:15 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) 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:7119 Archived-At: Jussi Piitulainen writes: > The documentation for reset and shift in the > manual does not quite say, but I believe the > captured continuation in these examples should be > the continuation of the shift expression inside > the reset expression, that is, it should simply > return the three values in all cases. Totally agree, this is the behaviour I expect > scheme@(guile-user)> (let ((k (reset (shift k k) (values 3.1 2 3)))) (k)) > $7 =3D 3.1 scheme@(guile=E2=88=92user)> (import (only (rnrs) let-values)) scheme@(guile=E2=88=92user)> (let ((k (reset (shift k k) (values 3.1 2 3)))= ) (k)) $40 =3D 3.1 scheme@(guile=E2=88=92user)> (let-values (((k) (reset (shift k k) (values 3= .1 2 3)))) (k)) $41 =3D 3.1 $42 =3D 2 $43 =3D 3 So, my first suspicion was that there is some part of the code that receives the multiple values in a let or something, but neither the code, nor the ,expand command revealed that. However, when we check with ,optimize (let ((k (call-with-prompt ((@@ (ice-9 control) default-prompt-tag)) (lambda () (apply abort ((@@ (ice-9 control) default-prompt-tag)) (lambda (cont) (call-with-prompt ((@@ (ice-9 control) default-prompt-tag)) (lambda () (lambda vals (call-with-prompt ((@@ (ice-9 control) default-prompt-tag)) (lambda () (@apply cont vals)) (lambda (cont f) (f cont))))) (lambda (cont f) (f cont)))) '()) 3.1) (lambda (cont f) (f cont))))) (k)) Gotcha. The optimizer is getting rid of the multiple values. On #guile, mark_weaver reminded me of http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D13966 which I think is the same issue. But I haven't tested that yet. --=20 Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled"