Welcome to the CHICKEN Scheme pasting service

fail to eval, but it can be eval in Gambit added by named let on Wed Feb 9 09:36:17 2022

(define (delete-adjacent-duplicates xs)
  (let loop ((prev-pair #f) (xs xs) (new-list '()))
    (if (null? xs)
        (reverse new-list)
        (loop xs
              (cdr xs)
              (let ((x (car xs)))
                (if (and prev-pair (equal? x (car prev-pair)))
                    new-list
                    (cons x new-list)))))))



(delete-adjacent-duplicates '(1 2 3 1 2 4 4 5 6 7 5))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which operator can be represented by an apostrophe?
Visually impaired? Let me spell it for you (wav file) download WAV