std-split-list


Synopsis

(std-split-list <n> <lst>)

Description

STD-SPLIT-LIST splits the list into sublists of maximal n elements.

Exceptional Situations

If n is 0 or negative an error is thrown, if n >= (length lst) a single list of lst is returned.

Example

(std-split-list 3 '(0 1 2 3 4 5 6 8 9)) 
=> ((0 1 2)(3 4 5)(6 7 8)(9)) (std-split-list 0 '(0 1 2 3 4 5 6 8 9))
=> Error (std-split-list 10 '(0 1 2 3 4 5 6 8 9))
=> ((0 1 2 3 4 5 6 7 8 9))

Arguments

n: any positive integer number >0.

lst: any proper list.

Return Value

A list of lists.

Side Effects

None.

Module

(std-require 'STDLIST)

Defined in STDLIST