From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo 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:19:23 +0100 Message-ID: <87bobha6as.fsf@pobox.com> 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 1361209634 32357 80.91.229.3 (18 Feb 2013 17:47:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Feb 2013 17:47:14 +0000 (UTC) Cc: 13741-done@debbugs.gnu.org To: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Feb 18 18:47:34 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 1U7UoP-0007Lm-Uj for guile-bugs@m.gmane.org; Mon, 18 Feb 2013 18:47:34 +0100 Original-Received: from localhost ([::1]:49019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7Uo4-00028Y-T1 for guile-bugs@m.gmane.org; Mon, 18 Feb 2013 12:47:12 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:60750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7UNy-0002aA-KK for bug-guile@gnu.org; Mon, 18 Feb 2013 12:20:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U7UNo-0006iV-9J for bug-guile@gnu.org; Mon, 18 Feb 2013 12:20:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57737) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U7UNn-0006gA-Lk for bug-guile@gnu.org; Mon, 18 Feb 2013 12:20:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U7UOl-00085K-0s for bug-guile@gnu.org; Mon, 18 Feb 2013 12:21:03 -0500 Resent-From: Andy Wingo Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: bug-guile@gnu.org Resent-Date: Mon, 18 Feb 2013 17:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 13741 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Mail-Followup-To: 13741@debbugs.gnu.org, wingo@pobox.com, mandyke@gmail.com Original-Received: via spool by 13741-done@debbugs.gnu.org id=D13741.136120803131036 (code D ref 13741); Mon, 18 Feb 2013 17:21:01 +0000 Original-Received: (at 13741-done) by debbugs.gnu.org; 18 Feb 2013 17:20:31 +0000 Original-Received: from localhost ([127.0.0.1]:34966 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7UOF-00084W-3q for submit@debbugs.gnu.org; Mon, 18 Feb 2013 12:20:31 -0500 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:55345 helo=sasl.smtp.pobox.com) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U7UOC-00084O-Bx for 13741-done@debbugs.gnu.org; Mon, 18 Feb 2013 12:20:29 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 407E9C125; Mon, 18 Feb 2013 12:19:27 -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=aNE0pqxvzQtR HOtbEsX8d6U+0Vw=; b=L3s/lO6Ez+6JhFYoEQb8JJd+2Qzp7wfrQojOzxsbXrcd q10ZsL7rYBTinvNM+8Tziin8YSVrO0EFvMseH/iHpaxVBu77sFxzPVPM4Myo0JAR L0yaaclKHxr8n6vu/scxXF630GqT2/cpb/0exMLnJDhla8dONbxR7inLciDTm+w= 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=eAjj80 4j1D9UQaux0m69N/VDaPBnYKKcwUJXH8o+XxhIPgR0bBE7TX/uOGBhc9A7b/hjPo E/tR3GqkiFeIBAlTW6vxR+J+9mmMlsMj5aDJiRC51fRe/PV1NgzCwpUrwm3SZjbv GOnZ4PiwJjuHiBzxffccmyHu7ljmvnDX64GHo= Original-Received: from a-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 36DC4C124; Mon, 18 Feb 2013 12:19:27 -0500 (EST) Original-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 9544AC123; Mon, 18 Feb 2013 12:19:26 -0500 (EST) In-Reply-To: <87k3q67zhy.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 18 Feb 2013 10:16:57 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Pobox-Relay-ID: 58BBF1C0-79EF-11E2-BA60-9A5B0E5B5709-02397024!a-pb-sasl-quonix.pobox.com 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:6745 Archived-At: On Mon 18 Feb 2013 10:16, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > 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. > > 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. Agreed, FWIW. Fractions are allocated on the heap, and eq? picks out the difference between heap objects. Sometimes two values are the same object, and sometimes not. Closing the bug, but please follow up with any questions. Cheers, Andy --=20 http://wingolog.org/