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))