X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=functions.lisp;h=9b4f6ed876bee6115b4b3a3b3d5a9c693759453c;hp=80f22211aa19474edc12e43f0530fce76b854dd6;hb=03712fbb06acbb103602bae10f41aeae7fa05127;hpb=739b14ee8844dc777b174105646df3abcb865282 diff --git a/functions.lisp b/functions.lisp index 80f2221..9b4f6ed 100644 --- a/functions.lisp +++ b/functions.lisp @@ -25,7 +25,7 @@ (multiple-value-bind (val foundp) (gethash args cache) (if foundp val - (setf (gethash args cache) (apply fn args))))))) + (setf (gethash args cache) (apply fn args))))))) (defun memoize (fn-name) (setf (fdefinition fn-name) (memo-proc (fdefinition fn-name)))) @@ -35,7 +35,7 @@ `(memoize (defun ,fn ,args . ,body))) (defmacro _f (op place &rest args) - (multiple-value-bind (vars forms var set access) + (multiple-value-bind (vars forms var set access) (get-setf-expansion place) `(let* (,@(mapcar #'list vars forms) (,(car var) (,op ,access ,@args))) @@ -46,7 +46,7 @@ (let ((fn1 (car (last fns))) (fns (butlast fns))) #'(lambda (&rest args) - (reduce #'funcall fns + (reduce #'funcall fns :from-end t :initial-value (apply fn1 args)))) #'identity))