Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: HenHanna Newsgroups: comp.lang.lisp Subject: Re: Detele repeated in a list Date: Sun, 21 Jul 2024 19:56:39 -0700 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 22 Jul 2024 04:56:41 +0200 (CEST) Injection-Info: dont-email.me; posting-host="5d36253aba82745bc2fb0c436e5e25c9"; logging-data="510394"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183vgk5X3IWTDo6WJgogiqW+C8yv+bIZZc=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:y4YNF334N0uq+fiVqh/VFDEwyfI= In-Reply-To: Content-Language: en-US Bytes: 1635 On 7/20/2024 5:21 PM, B. Pym wrote: > 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) > Gauche doesn't have RemDup built in?