X-Git-Url: https://git.distorted.org.uk/~mdw/lisp/blobdiff_plain/67b41ed338b6050f40bf9de24804502e96f84104..d7d819976cb5d84766bffd2c5272c86203687ee9:/mdw-base.lisp diff --git a/mdw-base.lisp b/mdw-base.lisp index ffda8c0..2c1a79c 100644 --- a/mdw-base.lisp +++ b/mdw-base.lisp @@ -13,12 +13,12 @@ ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2 of the License, or ;;; (at your option) any later version. -;;; +;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. -;;; +;;; ;;; You should have received a copy of the GNU General Public License ;;; along with this program; if not, write to the Free Software Foundation, ;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -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