GROUP-LIST

[GENERIC-FUNCTION]


OM 6.1
Function Reference
ARGUMENTS:
  - list list to group [default = (1 2 3 4)]
  - segmentation list of group lengths [default = (1 3)]
  - mode normal or circular [default = linear]

Description:

Segments a <list> in successives sublists which lengths are successive values of the list <segmentation>.
<mode> indicates if <list> is to be read in a circular way.

Ex. (group-list '(1 2 3 4) '(1 3) 'linear) => ((1) (2 3 4))
Ex. (group-list '(1 2 3 4) '(1 2 3) 'linear) => ((1) (2 3) (4))
Ex. (group-list '(1 2 3 4) '(1 2 3) 'circular) => ((1) (2 3) (4 1 2))