Quickutilβ

Lisp utilities on demand

Fork me on GitHub
search

There are 16 utilities.

partition-if v1.0

Partition sequences based off of a predicate.

Provides
partition-ifpartition-if-not
Source Code
 
equivalence-classes v1.0

Partition the sequence seq into a list of equivalence classes defined by the equivalence relation equiv.

Provides
equivalence-classes
Source Code
 
fix v1.0

Apply the fixed-point combinator, also known as the Y-combinator, to the function F : (A -> B) -> A -> B.

Provides
fix
Source Code
 
flip v1.0

Return a function whose argument order of a binary function f is reversed.

Provides
flip
Source Code
 
applyable v1.0

Given a function fun, return a variadic function which results in fun 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
Source Code
 
applying v1.0

Given a function fun, return a unary function whose result is applying fun to the single argument.

Provides
applying
Source Code
 
compose-apply v1.0

Create a variadic function whose result is applying the function fun to results obtained by applying each of funs 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
Source Code
 
ensure-function v1.0

Returns the function designated by function-designator: if function-designator is a function, it is returned, otherwise it must be a function name and its fdefinition is returned.

Provides
ensure-function
Source Code
 
ensure-functionf v1.0

Multiple-place modify macro for ensure-function: ensures that each of places contains a function.

Provides
ensure-functionf
Requires
ensure-function
Source Code
 
disjoin v1.0

Returns a function that applies each of predicate and more-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
Source Code
 
conjoin v1.0

Returns a function that applies each of predicate and more-predicate functions in turn to its arguments, returning nil 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
Source Code
 
compose v1.0

Returns a function composed of function and more-functions that applies its ; arguments to to each in turn, starting from the rightmost of more-functions, and then calling the next one with the primary value of the last.

Provides
compose
Requires
make-gensym-list, ensure-function
Source Code
 
multiple-value-compose v1.0

Returns a function composed of function and more-functions that applies its arguments to each in turn, starting from the rightmost of more-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
Source Code
 
curry v1.0

Returns a function that applies arguments and the arguments it is called with to function.

Provides
curry
Requires
make-gensym-list, ensure-function
Source Code
 
rcurry v1.0

Returns a function that applies the arguments it is called with and arguments to function.

Provides
rcurry
Requires
ensure-function
Source Code
 
named-lambda v1.0

Expands into a lambda-expression within whose body name denotes the corresponding function.

Provides
named-lambda
Source Code