From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.bugs Subject: bug#13741: guile-2.0: optimize, and eq-ness of literals (test-suite) Date: Mon, 18 Feb 2013 18:02:15 +0800 Message-ID: References: <87621q8fo4.fsf@gmail.com> <87k3q67zhy.fsf@gnu.org> 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 1361241022 19083 80.91.229.3 (19 Feb 2013 02:30:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 19 Feb 2013 02:30:22 +0000 (UTC) Cc: 13741@debbugs.gnu.org To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Feb 19 03:30:44 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 1U7cyf-0006rt-VD for guile-bugs@m.gmane.org; Tue, 19 Feb 2013 03:30:42 +0100 Original-Received: from localhost ([::1]:51572 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7cyL-0006ux-NZ for guile-bugs@m.gmane.org; Mon, 18 Feb 2013 21:30:21 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:50385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7cyH-0006uY-NL for bug-guile@gnu.org; Mon, 18 Feb 2013 21:30:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7cy9-0006cz-Fy for bug-guile@gnu.org; Mon, 18 Feb 2013 21:30:16 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:56649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7NYt-0008BT-PJ for bug-guile@gnu.org; Mon, 18 Feb 2013 05:03:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U7NZp-0004eK-Ui for bug-guile@gnu.org; Mon, 18 Feb 2013 05:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Hartwig Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 18 Feb 2013 10:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13741 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 13741-submit@debbugs.gnu.org id=B13741.136118180017822 (code B ref 13741); Mon, 18 Feb 2013 10:04:01 +0000 Original-Received: (at 13741) by debbugs.gnu.org; 18 Feb 2013 10:03:20 +0000 Original-Received: from localhost ([127.0.0.1]:33880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7NZ8-0004dM-Sr for submit@debbugs.gnu.org; Mon, 18 Feb 2013 05:03:20 -0500 Original-Received: from mail-ie0-f171.google.com ([209.85.223.171]:51315) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7NZ5-0004dE-Gf for 13741@debbugs.gnu.org; Mon, 18 Feb 2013 05:03:16 -0500 Original-Received: by mail-ie0-f171.google.com with SMTP id 10so6963194ied.2 for <13741@debbugs.gnu.org>; Mon, 18 Feb 2013 02:02:16 -0800 (PST) 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:content-transfer-encoding; bh=Fgs2bvKBUg5IDgb8xLgU7Rpo6gI/KM5g8W3UCQ/jqHs=; b=nKjOqaC8vL+1NoiDkrmA7UY4MLLYyqki2EcMBuNXTJq+9DJ+tRYS9cuCz6P9es6QxQ c+pLIZ/kFs5+7XYYU5IaHjMdlEMbz/NKb6flZQ7Kayy874TKwPBqpKruJ/IVpY95noQw RxEk9f3X46H63xLb9AXs7RtLTXseP6fjlskMQ+kNM97iz+8EFVm/wUhjEb1DbjfCZzeY Btfk4cncqjpA87z6kQMFRJydqid1md0TSkBp3w9JReoFH25qNogWUOjPVtkfK5RIMfga 1bsHX3vK2E5zFytcqyKm46+N1SH0xwi9Ybp9za/YoMKH/SynTtQglc1LUL+d0gM9W4PF Qj5g== X-Received: by 10.50.40.131 with SMTP id x3mr7195310igk.10.1361181735974; Mon, 18 Feb 2013 02:02:15 -0800 (PST) Original-Received: by 10.64.76.51 with HTTP; Mon, 18 Feb 2013 02:02:15 -0800 (PST) In-Reply-To: <87k3q67zhy.fsf@gnu.org> 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:6749 Archived-At: On 18 February 2013 17:16, Ludovic Court=C3=A8s wrote: > Daniel Hartwig skribis: > >> scheme@(guile-user)> (define x 1/2) >> scheme@(guile-user)> (eq? x 2/4) >> $7 =3D #f >> scheme@(guile-user)> ,optimize (eq? x 2/4) >> $8 =3D (eq? x 1/2) >> scheme@(guile-user)> (define y 2/4) >> scheme@(guile-user)> (eq? x y) >> $9 =3D #f >> scheme@(guile-user)> ,optimize (define y 2/4) >> $10 =3D (define y 1/2) > > Quoth R5RS: > > `Eq?''s behavior on numbers and characters is > implementation-dependent, but it will always return either true or > false, and will return true only when `eqv?' would also return > true. `Eq?' may also behave differently from `eqv?' on empty > vectors and empty strings. > > What we may get wrong is that it looks as if it doesn=E2=80=99t always re= turn > either true or false, because the behavior depends on whether one of the > operands is a literal. I took that to mean only that eq? always returns a boolean, rather than requiring it to return the same boolean given the same numeric arguments. It would be fine to simplify some rationals and not others, as this action does not affect the outcome of eqv?. > However, it=E2=80=99s fundamentally wrong to rely on eq? to compare numbe= rs. So > the test case you mention seems buggy, to start with. > > WDYT? > > Ludo=E2=80=99. Right, the test cases involving eq-ness of numbers are broken, should be removed. Patch to follow.