From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.user Subject: Re: Are `eqv?' and `eq?' the same? Date: Sun, 25 Aug 2013 21:13:14 +0100 Message-ID: <87txidedgl.fsf@Kagami.home> References: <5219ED00.9040006@gmx.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1377461616 2840 80.91.229.3 (25 Aug 2013 20:13:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2013 20:13:36 +0000 (UTC) Cc: guile-user@gnu.org To: Alexandru Cojocaru Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Aug 25 22:13:40 2013 Return-path: Envelope-to: guile-user@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 1VDggt-0001zr-US for guile-user@m.gmane.org; Sun, 25 Aug 2013 22:13:40 +0200 Original-Received: from localhost ([::1]:47492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDggt-0001So-BR for guile-user@m.gmane.org; Sun, 25 Aug 2013 16:13:39 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDggf-0001SX-SF for guile-user@gnu.org; Sun, 25 Aug 2013 16:13:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VDggb-0004ba-0k for guile-user@gnu.org; Sun, 25 Aug 2013 16:13:25 -0400 Original-Received: from mail-wi0-x22f.google.com ([2a00:1450:400c:c05::22f]:39113) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VDgga-0004ZI-Hi for guile-user@gnu.org; Sun, 25 Aug 2013 16:13:20 -0400 Original-Received: by mail-wi0-f175.google.com with SMTP id cb5so1021903wib.8 for ; Sun, 25 Aug 2013 13:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:mail-followup-to:date:in-reply-to :message-id:user-agent:mime-version:content-type :content-transfer-encoding; bh=7r3XjbhrGmyMAgptrb9JCJeTAuEgW7w49raWbgXjFi4=; b=IEuJsVcGidPX1liuGmukBiJ1Af/9bv2DGdmgPcWTRYnfI4Gmv7AfnoTmkyydh0vK/u lcxKzyJLE5FJWzrA2NIzYdYb3Ws1wo1B9iNRy1ShOoMGj4ZRoZck7FSe9mOmWe1VQuPi BoLbVj8DpWYM5cPg+omk9NpMd/TguHsc50hXb8ar5NW03xW4OZG6rIFctBcTOAQLodFX NzIxwQjbQLzRKgORyjGZQstbO5dscAgMtJ1oPCS8jzcShUvy120vtzded6L2Xi5XBQkA /NiLkjfPe09eDgVomBLuLiulKppRHDHdluGCvNLzV+opc+VPOiabxvOVzwcIojDYxnk3 Mhkw== X-Received: by 10.194.123.227 with SMTP id md3mr7256905wjb.17.1377461599874; Sun, 25 Aug 2013 13:13:19 -0700 (PDT) Original-Received: from Kagami.home (host81-155-30-214.range81-155.btcentralplus.com. [81.155.30.214]) by mx.google.com with ESMTPSA id ei6sm13347151wid.11.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 25 Aug 2013 13:13:18 -0700 (PDT) Mail-Followup-To: Alexandru Cojocaru , guile-user@gnu.org In-Reply-To: <5219ED00.9040006@gmx.com> (Alexandru Cojocaru's message of "Sun, 25 Aug 2013 13:39:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22f 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:10702 Archived-At: Alexandru Cojocaru writes: > =A0=A0=A0 `eq?' tests just for the same object (essentially a pointer > comparison) > =A0=A0=A0 `eqv?' extends `eq?' to look at the value of numbers and > characters. > > this is what I get: > > =A0=A0=A0 scheme@(guile-user)> (eq? 3 (+ 1 2)) > =A0=A0=A0 $1 =3D #t > > is this behavior intentional or some type of bug? The wording seems less than ideal, but the behaviour is perfectly fine, at least as far as the standard is concerned. Having said that my advice, to you, and to everyone reading this, is basically always use eqv?. No correct program will ever be broken by using it and the efficiency gains if eq? are marginal. --=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"