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

Bug in remove function



   There is a (large) bug in the implementation of the 'remove' operation in
MACL 1.3.2.  Here is a transcript that demonstrates the problem.

? (setq foo '(a b c d))
(A B C D)
? (remove 'c foo)
(A B D)                           ; Fine
? foo
(A B C D)                         ; Fine
? (remove 'c foo :start 1)
(B D)                             ; Wrong.  Should be (A B D) according to
                                  ; CLtL (1st ed., pg. 253)
                                  ; This is the result for
                                  ; (remove 'c (subseq foo :start 1))
? (remove 'c foo :start 2)
(B B B B B B B ...                ; WRONG. Returns a circular list of 'B!!!
                                  ; Still should be (A B D)

  Is there any way to patch this problem in 1.3.2?  Also, the error handling
routine doesn't detect the circular list and tries to print it out.  This makes
it inconvenient to diagnose the problem.

  By the way, what happened to bug-macl@cambridge.apple.com?

             - John Canning