chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] BUG: Error in SRFI-1 reference definition


From: John Cowan
Subject: [Chicken-users] BUG: Error in SRFI-1 reference definition
Date: Tue, 30 May 2006 17:43:55 -0400
User-agent: Mutt/1.3.28i

There is a bug in the SRFI reference implementation used by Chicken
(and various other Schemes) for LIST=.  The bug was characterized
by saccade and found by Riastradh.  Here is a revised definition
of LIST=:

(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)        ; EQ? => LIST=
                  (lp1 list-b others)
                  (let lp2 ((la list-a) (lb list-b))
                    (if (null-list? la)
                        (and (null-list? lb)
                             (lp1 list-b others))
                        (and (not (null-list? lb))
                             (= (car la) (car lb))
                             (lp2 (cdr la) (cdr lb)))))))))))

The expression "(list= eq? '(a) '(a) '(a))" was incorrectly returning #f.

Pkease fix.


-- 
Winter:  MIT,                                   John Cowan
Keio, INRIA,                                    address@hidden
Issue lots of Drafts.                           http://www.ccil.org/~cowan
So much more to understand!
Might simplicity return?                        (A "tanka", or extended haiku)




reply via email to

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