From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Atticus Newsgroups: gmane.lisp.guile.bugs Subject: bug#21855: eq? Date: Sun, 08 Nov 2015 14:30:42 +0100 Message-ID: <87pozkoby5.fsf@posteo.org> References: <87r3k2ezjr.fsf@posteo.org> <20151108102323.GA5299@tuxteam.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1446989543 17714 80.91.229.3 (8 Nov 2015 13:32:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Nov 2015 13:32:23 +0000 (UTC) Cc: 21855@debbugs.gnu.org To: tomas@tuxteam.de Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Nov 08 14:32:14 2015 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 1ZvQ4p-00061Y-9q for guile-bugs@m.gmane.org; Sun, 08 Nov 2015 14:32:11 +0100 Original-Received: from localhost ([::1]:47407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvQ4o-00031w-4f for guile-bugs@m.gmane.org; Sun, 08 Nov 2015 08:32:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40636) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvQ4k-00031N-KX for bug-guile@gnu.org; Sun, 08 Nov 2015 08:32:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvQ4g-0004t8-6L for bug-guile@gnu.org; Sun, 08 Nov 2015 08:32:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:38419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvQ4g-0004t4-3s for bug-guile@gnu.org; Sun, 08 Nov 2015 08:32:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZvQ4f-0001xo-QH for bug-guile@gnu.org; Sun, 08 Nov 2015 08:32:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Atticus Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 08 Nov 2015 13:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21855 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 21855-submit@debbugs.gnu.org id=B21855.14469894697476 (code B ref 21855); Sun, 08 Nov 2015 13:32:01 +0000 Original-Received: (at 21855) by debbugs.gnu.org; 8 Nov 2015 13:31:09 +0000 Original-Received: from localhost ([127.0.0.1]:57360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvQ3o-0001wV-Iv for submit@debbugs.gnu.org; Sun, 08 Nov 2015 08:31:08 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:48451) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZvQ3T-0001un-1F for 21855@debbugs.gnu.org; Sun, 08 Nov 2015 08:31:07 -0500 Original-Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id E22CF20946 for <21855@debbugs.gnu.org>; Sun, 8 Nov 2015 14:30:45 +0100 (CET) Original-Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3ntxD54DCQz5vLS; Sun, 8 Nov 2015 14:30:45 +0100 (CET) In-Reply-To: <20151108102323.GA5299@tuxteam.de> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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:7883 Archived-At: tomas@tuxteam.de writes: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Sat, Nov 07, 2015 at 01:58:48PM +0100, Atticus wrote: >> So I wanted to try out gnu guix and thus make myself more familiar with >> guile first. While running some tests I encountered a problem/bug with eq?: >> >> $ guile -v >> guile (GNU Guile) 2.1.1 >> >> $ guile >> scheme@(guile-user)> >> (define (multirember a lat) >> (cond >> ((null? lat) '()) >> ((eq? (car lat) a) (multirember a (cdr lat))) >> (else (cons (car lat) (multirember a (cdr lat)))))) >> >> scheme@(guile-user)> (multirember '(a b) '(x y (a b) z (a b))) >> $1 = (x y z) >> >> So why does guile return (x y z)? I expected (x y (a b) z (a b)). I know >> eq? should only be used with symbols (and thus this example is more >> theoretical) but nevertheless the return value is not right, since (eq? >> '(a b) '(a b)) returns #f (Btw same in guile 2.0.11). > > Hm. As far as I know (eq? '(a b) '(a b)) is not *guaranteed* to evaluate > to #f. The implementation might be free to re-use things it "knows" to be > constant (I might be wrong, though). Yes you are right that the implementation may treat it as non #f if both arguments refer to the same object. In r5rs (and also r6rs) (eq? '(a) '(a)) is unspecified (r5rs, page 19) and thus implementation dependant but I don't think the behaviour of eq? is consistent in guile. As I said (eq? '(a b) '(a b)) on its own returns #f and imho there is no reason why eq? inside a procedure (in this example in 'multirember') should behave different, since the '(a b) in the second argument does not refer to the '(a b) of the first argument. Since it's not clear if this is a "real" bug, perhaps a further discussion at guile-user@gnu.org would be better. What is the recommended proceeding in such a case? A reply with the pseudo-header "X-Debbugs-CC: guile-user@gnu.org"? Or is that not necessary and a simple mail to guile-user to discuss this topic is sufficient? Btw sorry for the bad bug report, I shoud have read the documentation (didn't include the necessary pseudo-headers)