I am using Intermediate Student with Lambda in DrRacket, I was wondering how one would remove the duplicates in a list, while keeping the order. For example (remo
(remo
Old question, but this is an implementation of J-Y's idea.
(define (dup-rem lst) (cond [(empty? lst) empty] [else (cons (first lst) (dup-rem (filter (lambda (x) (not (equal? (first lst) x))) lst)))]))