Next: Strings, Previous: Optional Arguments, Up: API Reference [Contents][Index]
Grip procedures to process lists. The module is loaded by entering the following:
(use-modules (grip list))
list-pos
list-insert
list-replace-all
interleave
flatten
Returns the index of the first element in lst which statisfies
(pred element item)
. Otherwise, it returns #f
.
Returns a list.
Inserts item at the beginning of lst if pos is
inferior or equal to zero
, at the given position if pos is
inferior to the length of lst, and at the end of lst if
pos is equal or superior to the length of lst.
Returns a list.
All elements in lst that satisfies (pred element old)
are
replaced by new.
Returns a list.
The result is the concatenation of the tuples composed of one element of
l1 l2 l3 … taken at the same index. The first index is
zero
, the last idex is (- n 1)
, where n
is the
length of the shortest list.
Returns a ‘non-nested’ list obtained by removing all ‘nested structure’ from lst, while retaining all of its elements, hence flattening lst.
For example:
(flatten '(1 2 (3) (4 (5 (6 (7 8) 9) (10 11))) 12)) -| $4 = (1 2 3 4 5 6 7 8 9 10 11 12)
Next: Strings, Previous: Optional Arguments, Up: API Reference [Contents][Index]