14 Lists
This library is unstable; compatibility will not be maintained. See Unstable: May Change Without Warning for more information.
(require unstable/list) | package: unstable-list-lib |
procedure
(list-prefix? l r) → boolean?
l : list? r : list?
Example: | ||
|
procedure
(take-common-prefix l r #:same? same?) → list?
l : list? r : list? same? : equal?
Example: | ||
|
Example: | ||||
|
procedure
(split-common-prefix l r #:same? same?) →
list? list? list? l : list? r : list? same? : equal?
Example: | |||||
|
The subsequent bindings were added by Sam Tobin-Hochstadt.
procedure
(filter-multiple l f ...) →
list? ... l : list? f : procedure?
Example: | ||||
|
Example: | ||
|
The subsequent bindings were added by Ryan Culpepper.
procedure
(check-duplicate lst [ #:key extract-key #:same? same?]) → (or/c any/c #f) lst : list? extract-key : (-> any/c any/c) = (lambda (x) x)
same? :
(or/c (any/c any/c . -> . any/c) dict?) = equal?
The same? argument can either be an equivalence predicate such as equal? or eqv? or a dictionary. In the latter case, the elements of the list are mapped to #t in the dictionary until an element is discovered that is already mapped to a true value. The procedures equal?, eqv?, and eq? automatically use a dictionary for speed.
Examples: | |||||||||||||||||||
|
The subsequent bindings were added by Carl Eastlund.
procedure
(map/values n f lst ...) →
(listof B_1) ... (listof B_n) n : natural-number/c f : (-> A ... (values B_1 ... B_n)) lst : (listof A)
Example: | ||||||||||
|
Example: | ||||
|
The subsequent bindings were added by David Van Horn.
procedure
pred : procedure? lst : list?
Example: | ||
|
The subsequent bindings were added by Vincent St-Amour.
Example: | ||
|
procedure
(cartesian-product lst ...) → (listof (listof A))
lst : (listof A)
Examples: | ||||||||||||||||||||||
|
The subsequent bindings were added by Eric Dobson.
procedure
(list-update lst index updater) → list?
lst : list? index : (and/c (>=/c 0) (</c (length lst))) updater : (-> any/c any/c)
Example: | ||
|
Example: | ||
|