Hi there,
Recently a user of Gauche pointed out a bug of list=, which is actually originated from the reference implementation of srfi-1. I think the same bug is still in snow's srfi1 package (1.0.15). Try this:
(list= = '(1 2 3) '(1 2 3) '(1 2 3))
Here's a fixed version in Gauche. The point is that you have to preserve either list-a or list-b in order to loop over lp1 again.
(define (list= = . lists) (or (null? lists) ; special case
(let lp1 ((list-a (car lists)) (others (cdr lists))) (or (null? others) (let ((list-b (car others)) (others (cdr others))) (if (eq? list-a list-b) (lp1 list-b others) (let lp2 ((list-a list-a) (list-c list-b)) (if (null-list? list-a) (and (null-list? list-c) (lp1 list-b others)) (and (not (null-list? list-c)) (= (car list-a) (car list-c)) (lp2 (cdr list-a) (cdr list-c)))))))))))
--shiro
Afficher les réponses par date
snow-users-list@iro.umontreal.ca