Email list hosting service & mailing list manager

Error in the sample implementation Marc Nieper-Wißkirchen (18 Sep 2020 18:04 UTC)
Re: Error in the sample implementation Arthur A. Gleckler (18 Sep 2020 18:10 UTC)
Re: Error in the sample implementation Marc Nieper-Wißkirchen (18 Sep 2020 18:19 UTC)
Re: Error in the sample implementation Arthur A. Gleckler (18 Sep 2020 18:22 UTC)

Error in the sample implementation Marc Nieper-Wißkirchen 18 Sep 2020 18:03 UTC

I just found a bug in the sample implementation by chance, namely in
the definition of ‘delete-duplicates!’, which is missing a "." before
‘maybe-=’. The sad thing about it is that Scheme is apparently used so
seldom that no come across the bug for 20 years.

(define (delete-duplicates! lis <DOT> maybe-=)
  (let ((elt= (:optional maybe-= equal?)))
    (check-arg procedure? elt= delete-duplicates!)
    (let recur ((lis lis))
      (if (null-list? lis) lis
 (let* ((x (car lis))
(tail (cdr lis))
(new-tail (recur (delete! x tail elt=))))
   (if (eq? tail new-tail) lis (cons x new-tail)))))))