seq

https://github.com/NicolasPetton/seq.el.git

git clone 'git://github.com/NicolasPetton/seq.el.git'
91

seq.el Build Status

Summary

seq.el provides Sequence manipulation functions that complement basic functions provided by subr.el. The library is included in Emacs 25.

All functions are prefixed with seq-.

All provided functions work on lists, strings and vectors.

Functions taking a predicate or iterating over a sequence using a function as argument take the function as their first argument and the sequence as their second argument. All other functions take the sequence as their first argument.

All functions are tested in test/seq-tests.el

Functions

seq.el provides the following functions:

This function returns a sequence of all but the first n elements of the sequence seq.

seq may be a list, vector or string and n must be an integer. The result is the same type of sequence as seq.

If n is a negative integer or zero, seq is returned.

This function returns a sequence of the first n elements of seq.

seq may be a list, vector or string and n must be an integer. The result is the same type of sequence as seq.

If n is a negative integer or zero, an empty sequence is returned.

This function returns a sub-sequence of the successive elements of seq for which calling pred with that element returns non-nil.

pred must be a one-argument function and seq may be a list, vector or string. The result is the same type of sequence as seq.

If evaluating pred with the first element of seq as argument returns nil, an empty sequence is returned.

This function returns a sub-sequence of seq from the first element for which calling pred with that element returns nil.

pred must be a one-argument function and seq may be a list, vector or string. The result is the same type of sequence as seq.

If evaluating pred with every element of seq returns nil, seq is returned.

This function returns a list of all the elements in seq for which calling pred with that element returns non-nil.

pred must be a one-argument function and seq may be a list, vector or string.

pred must be a one-argument function and seq may be a list, vector or string.

This function returns the result of calling function with initial-value and the first element of seq, then calling function with that result and the second element of seq, then with that result and the third element of seq, etc.

function must be a two-arguments function and seq may be a list, vector or string.

If seq is empty, initial-value is returned and function is not called.

pred must be a one-argument function and seq may be a list, vector or string.

pred must be a one-argument function and seq may be a list, vector or string.

seq may be a list, vector or string.

pred must be a one-argument function and seq may be a list, vector or string.

pred must be a two-arguments function, seq may be a list, vector or string.

The result is a sequence of the same type as SEQ.

Equality is defined by testfn if non-nil or by equal if nil.

seq may be a list, vector or string.

testfn must be a two-argument function or nil and seq may be a list, vector or string.

seq may be a list, vector or string. The result is the same type of sequence as seq.

seq-doseq is primarily useful for side-effects.

Contributing

Since this library is in Emacs 25, contributors must have signed the Emacs Copyright assignment.

Fetch dependencies:

$ cd /path/to/seq.el
$ cask

Run the tests:

$ ./run-tests.sh