From: Mark Wooding Date: Tue, 3 Jul 2007 12:18:25 +0000 (+0100) Subject: mdw-base (functionify): Coerce function designator to function. X-Git-Url: https://git.distorted.org.uk/~mdw/lisp/commitdiff_plain/f5612edb087fb1883958d0fbf37331b6d9119042 mdw-base (functionify): Coerce function designator to function. --- diff --git a/mdw-base.lisp b/mdw-base.lisp index 646eb7e..2c1a79c 100644 --- a/mdw-base.lisp +++ b/mdw-base.lisp @@ -31,7 +31,8 @@ (:export #:unsigned-fixnum #:compile-time-defun #:show - #:stringify #:mappend #:listify #:fix-pair #:pairify + #:stringify #:functionify #:mappend + #:listify #:fix-pair #:pairify #:parse-body #:with-parsed-body #:whitespace-char-p #:slot-uninitialized @@ -83,6 +84,13 @@ (symbol (symbol-name str)) (t (princ-to-string str)))) +(defun functionify (func) + "Convert the function-designator FUNC to a function." + (declare (type (or function symbol) func)) + (etypecase func + (function func) + (symbol (symbol-function func)))) + (defun mappend (function list &rest more-lists) "Apply FUNCTION to corresponding elements of LIST and MORE-LISTS, yielding a list. Return the concatenation of all the resulting lists. Like