|
@@ -45,11 +45,16 @@
|
|
|
',name)))
|
|
|
|
|
|
(defun get-expansion (expression)
|
|
|
- (let (expansion-function)
|
|
|
- (loop for (name test expander) in *rules*
|
|
|
- do (if (apply test expression)
|
|
|
- (setf expansion-function expander)))
|
|
|
- expansion-function))
|
|
|
+ (first
|
|
|
+ (remove-if #'null
|
|
|
+ (map 'list
|
|
|
+ #'(lambda (nte)
|
|
|
+ (let ((test (second nte))
|
|
|
+ (expander (third nte)))
|
|
|
+ (if (apply test expression)
|
|
|
+ expander
|
|
|
+ nil)))
|
|
|
+ *rules*))))
|
|
|
|
|
|
(defun derive (function)
|
|
|
(declare (cons function))
|