(slib common-list-functions)

(adjoin obj lst)

Returns list with object added, unless object already in the list

(fold-left f i l)

fold-left takes a function whose arguments are (accumulated-value next-item) this agrees with fold-left from R6RS, but is different to fold in SRFI 1 e.g. (fold-left f i '(a b c)) computes (f (f (f i a) b) c)

(fold-right f i l)

(fold-right f i '(a b c)) computes (f a (f b (f c i)))

(reduce pred? lst)

a convenient version of fold-left taking its initial argument from the start of the list.

(position obj lst)

Returns the left-most index of obj in lst, or #f if it is not present. Note, list-index in srfi-1 uses a procedure to test for the object, so this is effectively (list-index (lambda (o) (eqv? o obj)) lst)