Deutsch English Français Italiano |
<v7hka3$3oudp$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!npeer.as286.net!npeer-ng0.as286.net!3.eu.feeder.erje.net!feeder.erje.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "B. Pym" <Nobody447095@here-nor-there.org> Newsgroups: comp.lang.lisp Subject: Re: Detele repeated in a list Date: Sun, 21 Jul 2024 00:21:28 -0000 (UTC) Organization: A noiseless patient Spider Lines: 25 Message-ID: <v7hka3$3oudp$1@dont-email.me> References: <v7hj6b$3ooop$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Injection-Date: Sun, 21 Jul 2024 02:21:28 +0200 (CEST) Injection-Info: dont-email.me; posting-host="7b0a8e365f2abfcb427a2f6d66b0136c"; logging-data="3963321"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1++QCp5ffcpkwrp8UFjPq04" User-Agent: XanaNews/1.18.1.6 Cancel-Lock: sha1:JTtq+QFzewkA7jLvKD5Yat57g70= Bytes: 1442 B. Pym wrote: > Pascal Costanza wrote: > > > (defun rem-duplicates (list) > > (loop for (first . rest) on (append list list) > > unless (member first (reverse rest) :test #'equal) > > collect first)) > > Gauche Scheme > > (define (rem-dups lst) > (fold > (lambda (x accum) (if (member x accum) accum (cons x accum))) > '() > lst)) > > (rem-dups '(0 2 3 4 (8 7) 3 2 0 (8 7))) > ===> > (4 3 2 0 (8 7)) Actual result: ((8 7) 4 3 2 0)