reorder stuff

This commit is contained in:
Ivan Malison 2016-06-06 23:05:33 -07:00
parent 88cc27b890
commit 23d93f3d2a

View File

@ -50,16 +50,16 @@ Death to any gui elements in emacs! Do this EARLY so that emacs doesn't redispla
** Compose functions taking arbitrarily many arguments and returning arbitrarily many arguments ** Compose functions taking arbitrarily many arguments and returning arbitrarily many arguments
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(defmacro imalison:compose (name &rest funcs)
"Build a new function with NAME that is the composition of FUNCS."
`(defun ,name (&rest args)
(imalison:compose-helper ,funcs)))
(defun imalison:make-list (thing) (defun imalison:make-list (thing)
(if (listp thing) (if (listp thing)
thing thing
(list thing))) (list thing)))
(defmacro imalison:compose (name &rest funcs)
"Build a new function with NAME that is the composition of FUNCS."
`(defun ,name (&rest args)
(imalison:compose-helper ,funcs)))
(defmacro imalison:compose-helper (funcs) (defmacro imalison:compose-helper (funcs)
"Builds funcalls of FUNCS applied to the arg." "Builds funcalls of FUNCS applied to the arg."
(if (equal (length funcs) 0) (if (equal (length funcs) 0)