chiark
/
gitweb
/
~mdw
/
lisp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
heap: Simple binary heaps for priority queues and so on.
[lisp]
/
mdw-base.lisp
diff --git
a/mdw-base.lisp
b/mdw-base.lisp
index 646eb7e7574b0cba9da669e5bda24efaf8e19f26..2c1a79c2286cf539e13c48b10ba27b030a59f5f1 100644
(file)
--- a/
mdw-base.lisp
+++ b/
mdw-base.lisp
@@
-31,7
+31,8
@@
(defpackage #:mdw.base
(:export #:unsigned-fixnum
#:compile-time-defun
#:show
(: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
#:parse-body #:with-parsed-body
#:whitespace-char-p
#:slot-uninitialized
@@
-83,6
+84,13
@@
(defun stringify (str)
(symbol (symbol-name str))
(t (princ-to-string str))))
(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
(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