• collect-repeats (Tasters Wanted)

    From HenHanna@21:1/5 to All on Thu Aug 15 15:48:53 2024
    (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)))

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)