From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: or values bug? Date: Tue, 06 Dec 2011 19:23:39 +0100 Message-ID: <87y5upmudw.fsf@pobox.com> References: <20111205143331.GA2681@ccellier.rd.securactive.lan> <87obvmhq7x.fsf@gnu.org> <871usirb2s.fsf@pobox.com> <87wraapwcz.fsf@pobox.com> <878vmpk2hf.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1323195835 16828 80.91.229.12 (6 Dec 2011 18:23:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 6 Dec 2011 18:23:55 +0000 (UTC) Cc: guile-user@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 06 19:23:51 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RXzgF-0006i4-GA for guile-user@m.gmane.org; Tue, 06 Dec 2011 19:23:51 +0100 Original-Received: from localhost ([::1]:52660 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXzgE-000841-SI for guile-user@m.gmane.org; Tue, 06 Dec 2011 13:23:50 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXzgB-00083w-0y for guile-user@gnu.org; Tue, 06 Dec 2011 13:23:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXzg9-0005PP-Dl for guile-user@gnu.org; Tue, 06 Dec 2011 13:23:46 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:56032 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXzg9-0005PK-7L; Tue, 06 Dec 2011 13:23:45 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 7450D85D5; Tue, 6 Dec 2011 13:23:44 -0500 (EST) 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:content-transfer-encoding; s=sasl; bh=KqvvMceasCV+ anXd7/XT1Q4G4EQ=; b=IRyLeiWcYXwQw/bLA4dk3+tLBOI3cAoYnNH3taN95m/o 8ObTCItVWM/ddQ7KSBcTmPgEtin7RyWf76haa8kld/qupbIUvAhf0zuvmM/s1SSS QWwo4hCqOxiO/oXWrrWkjzXeXpl+OxL3QQgh3BMFkOcVijWpx8pdVmXwg43kRkU= 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:content-transfer-encoding; q=dns; s=sasl; b=JhCRH1 imgveAYQk6iXhENCABsyaFqOdNQFts69CL7ELdojVa2vg2n03bORwG3iem87JNo5 KfoKRODKdEP530ZuX8mPhGCKMt/zNZ8V/+s8BUy/c0VqALwZvtJefrHaKMxih39p zHE5UpEZ7yykoCbB0sbBCpWJPuB7WjZuV82Fw= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 6C85485CE; Tue, 6 Dec 2011 13:23:44 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id D892385CA; Tue, 6 Dec 2011 13:23:43 -0500 (EST) In-Reply-To: <878vmpk2hf.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Tue, 06 Dec 2011 18:57:00 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: 6E1A7310-2037-11E1-9A48-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:9041 Archived-At: Hey, thanks for looking at this! On Tue 06 Dec 2011 18:57, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Hi Andy, > > Andy Wingo skribis: > >> Rather, something like: >> >> (define (truncate x) >> (match x >> (() x) >> ;; similar provably singly-valued cases here >> (else (make-primcall #f 'values (list x))))) > > I suspect it=E2=80=99s often the case that it cannot be proved, for insta= nce > when a lambda calls a top-level. In all those cases, we=E2=80=99d end up > wrapping the expression in (values (list EXP)), which seems like a bad > idea. For the purposes of peval, this is probably fine. Are there any expressions for which we don't know the number of values that we allow to propagate? But if the operand residualizes, it would be nice to avoid turning (let ((x (foo))) (+ 1 x)) into (let ((x (values (foo)))) (+ 1 x)) as in this case the `values' is completely unnecessary. Peval could handle it, or compile-glil.scm could handle it. Other than those comments, the patch looks nice to me! Andy --=20 http://wingolog.org/