There are 16 utilities.
- partition-if v1.0
-
Partition sequences based off of a predicate.
- Provides
partition-if
,partition-if-not
- equivalence-classes v1.0
-
Partition the sequence
seq
into a list of equivalence classes defined by the equivalence relationequiv
.- Provides
equivalence-classes
- fix v1.0
-
Apply the fixed-point combinator, also known as the Y-combinator, to the function
F : (A -> B) -> A -> B
.- Provides
fix
- flip v1.0
-
Return a function whose argument order of a binary function
f
is reversed.- Provides
flip
- applyable v1.0
-
Given a function
fun
, return a variadic function which results infun
being called on the passed argument list. (Note:fun
will not be applied to the passed argument list.)The resulting function is able to be applied to lists as a result (hence "appliable").
- Provides
applyable
- applying v1.0
-
Given a function
fun
, return a unary function whose result is applyingfun
to the single argument.- Provides
applying
- compose-apply v1.0
-
Create a variadic function whose result is applying the function
fun
to results obtained by applying each offuns
to the argument list.Example:
` (defvar average-values (compose-apply '/ '+ (applyable 'length))) (defvar average-list (compose-apply '/ (applying '+) 'length))
(funcall average-values 1 2 3) => 2 (funcall average-list '(1 2 3) => 2 ```
- Provides
compose-apply
- ensure-function v1.0
-
Returns the function designated by
function-designator
: iffunction-designator
is a function, it is returned, otherwise it must be a function name and itsfdefinition
is returned.- Provides
ensure-function
- ensure-functionf v1.0
-
Multiple-place modify macro for
ensure-function
: ensures that each ofplaces
contains a function.- Provides
ensure-functionf
- Requires
- ensure-function
- disjoin v1.0
-
Returns a function that applies each of
predicate
andmore-predicate
functions in turn to its arguments, returning the primary value of the first predicate that returns true, without calling the remaining predicates. If none of the predicates returns true,nil
is returned.- Provides
disjoin
- Requires
- ensure-function
- conjoin v1.0
-
Returns a function that applies each of
predicate
andmore-predicate
functions in turn to its arguments, returningnil
if any of the predicates returns false, without calling the remaining predicates. If none of the predicates returns false, returns the primary value of the last predicate.- Provides
conjoin
- compose v1.0
-
Returns a function composed of
function
andmore-functions
that applies its ; arguments to to each in turn, starting from the rightmost ofmore-functions
, and then calling the next one with the primary value of the last.- Provides
compose
- Requires
- make-gensym-list, ensure-function
- multiple-value-compose v1.0
-
Returns a function composed of
function
andmore-functions
that applies its arguments to each in turn, starting from the rightmost ofmore-functions
, and then calling the next one with all the return values of the last.- Provides
multiple-value-compose
- Requires
- make-gensym-list, ensure-function
- curry v1.0
-
Returns a function that applies
arguments
and the arguments it is called with tofunction
.- Provides
curry
- Requires
- make-gensym-list, ensure-function
- rcurry v1.0
-
Returns a function that applies the arguments it is called with and
arguments
tofunction
.- Provides
rcurry
- Requires
- ensure-function
- named-lambda v1.0
-
Expands into a lambda-expression within whose
body
name
denotes the corresponding function.- Provides
named-lambda