Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #271: The kernel license has expired


comp / comp.lang.lisp / collect-repeats (Tasters Wanted)

SubjectAuthor
o collect-repeats (Tasters Wanted)HenHanna

1
Subject: collect-repeats (Tasters Wanted)
From: HenHanna
Newsgroups: comp.lang.lisp
Organization: A noiseless patient Spider
Date: Thu, 15 Aug 2024 22:48 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: HenHanna@devnull.tb (HenHanna)
Newsgroups: comp.lang.lisp
Subject: collect-repeats (Tasters Wanted)
Date: Thu, 15 Aug 2024 15:48:53 -0700
Organization: A noiseless patient Spider
Lines: 20
Message-ID: <v9m0km$14cad$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 16 Aug 2024 00:48:54 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="e3136333d5489221ac298a31ddaa858b";
logging-data="1192269"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18jFygs0Wy5lA57YuAHjI08LoBRdHDpwmU="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:9/5A+GZWYJftUCPPTMcOgXpi21w=
Content-Language: en-US
View all headers

(use gauche.sequence)

(define (ColRep x)
(filter (cut > (length <>) 1) (group-sequence x))) ; --- Doesn't work!

----------- possible to write this using CUT ?

(define (ColRep x)
(filter (lambda (x) (> (length x) 1)) (group-sequence x)))

(define (ColRep x)
(filter (^x (pair? (cdr x))) (group-sequence x)))

(print (ColRep '(1 2 4 4 0 5 5 8 8 8 6)) )
(print (ColRep '(4 4 0 5 5 8 8 8 6 1 2 3 4 1 2 3 4)))

1

rocksolid light 0.9.8
clearnet tor