bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#21855: eq?


From: Atticus
Subject: bug#21855: eq?
Date: Sat, 07 Nov 2015 13:58:48 +0100
User-agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]