unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: Atticus <atticus0@posteo.org>
Cc: 21855@debbugs.gnu.org
Subject: bug#21855: eq?
Date: Sun, 8 Nov 2015 11:23:23 +0100	[thread overview]
Message-ID: <20151108102323.GA5299@tuxteam.de> (raw)
In-Reply-To: <87r3k2ezjr.fsf@posteo.org>

-----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).

Regards
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlY/IpsACgkQBcgs9XrR2kZMoACZAc49Kzq9JzteJovmzRpH2WLv
M3YAnibf8NUd5bspCqCP2cQiAWNSiREt
=O1dE
-----END PGP SIGNATURE-----





  reply	other threads:[~2015-11-08 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 12:58 bug#21855: eq? Atticus
2015-11-08 10:23 ` tomas [this message]
2015-11-08 13:30   ` Atticus
2015-11-08 13:38     ` tomas
2015-11-09  7:57       ` Atticus
2016-06-24 15:31   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151108102323.GA5299@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=21855@debbugs.gnu.org \
    --cc=atticus0@posteo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).