< Back to IRCAM Forum

Grouping equal consecutive elements

Good evening everyone,
I would like a suggestion.
I would like to start from a list like

(1 1 1 2 2 3 1 1),

process it and get a list like

((1 1 1) (2 2) (3) (1 1)).

What approach would you use?

Thank you

F

Hi fravi

Here is some code.

Best
K
group-successive.lisp (682 Bytes)

…Will be included in the coming new version. (soon)

Hi Karim,
thanks a lot for the code and the answer’s speed.
I’m so happy that it will be included in the next version (6.19?)

Francesco

Yes indeed 6.19 – coming soon. Need to make some testing first.

Best
K

1 Like

Ok!
So, good work!

F