Skip to content
Snippets Groups Projects
Commit 655212e0 authored by Tobias C. Rittweiler's avatar Tobias C. Rittweiler
Browse files

alexandria-functions-really-shutup-notes.diff

parent 07f929ab
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,16 @@ ...@@ -2,6 +2,16 @@
(declaim (inline ensure-function)) ; to propagate return type. (declaim (inline ensure-function)) ; to propagate return type.
(declaim (ftype (function (t) (values function &optional))
ensure-function))
(defun ensure-function (function-designator)
"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."
(if (functionp function-designator)
function-designator
(fdefinition function-designator)))
(defun disjoin (predicate &rest more-predicates) (defun disjoin (predicate &rest more-predicates)
"Returns a function that applies each of PREDICATE and MORE-PREDICATE "Returns a function that applies each of PREDICATE and MORE-PREDICATE
functions in turn to its arguments, returning the primary value of the first functions in turn to its arguments, returning the primary value of the first
...@@ -120,14 +130,4 @@ with and ARGUMENTS to FUNCTION." ...@@ -120,14 +130,4 @@ with and ARGUMENTS to FUNCTION."
"Expands into a lambda-expression within whose BODY NAME denotes the "Expands into a lambda-expression within whose BODY NAME denotes the
corresponding function." corresponding function."
`(labels ((,name ,lambda-list ,@body)) `(labels ((,name ,lambda-list ,@body))
#',name)) #',name))
\ No newline at end of file
(declaim (ftype (function (t) (values function &optional))
ensure-function))
(defun ensure-function (function-designator)
"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."
(if (functionp function-designator)
function-designator
(fdefinition function-designator)))
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment