Hmm, I recently had a racket exam: /
"standard" remove-duplicates works fine, but I used a rather large drRacket file, so I had to download it with (require racket/list)
here is an alternative way :)
using a mutation (not really in the spirit of a racket, but .. it works.)
(define (set l) (define the-set '()) (begin (for-each (lambda (x) (if (member x the-set) #t (set! the-set (cons x the-set)))) l) (reverse the-set)))
Hope this helps ... cheers!
source share