X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?p=clnl;a=blobdiff_plain;f=src%2Fmain%2Fnvm%2Futils.lisp;h=0a5f60486a61cee023770b7cddd5332d3e046b62;hp=f95fb7fd8e5dd55044acb9fd7b86da7bd1e6502b;hb=807df6b;hpb=3ae0c35e27580b247652dff608dd8c4d29f16bff diff --git a/src/main/nvm/utils.lisp b/src/main/nvm/utils.lisp index f95fb7f..0a5f604 100644 --- a/src/main/nvm/utils.lisp +++ b/src/main/nvm/utils.lisp @@ -39,12 +39,13 @@ (defmacro with-patch-update (turtle &rest forms) (let - ((patch (gensym)) (new-patch (gensym))) + ((patch (gensym)) (new-patch (gensym)) (retn (gensym))) `(let ((,patch (patch-at (turtle-xcor ,turtle) (turtle-ycor ,turtle))) - (retn (progn ,@forms))) + (,retn (progn ,@forms))) (let ((,new-patch (patch-at (turtle-xcor ,turtle) (turtle-ycor ,turtle)))) (when (not (eql ,patch ,new-patch)) (setf (patch-turtles ,patch) (remove ,turtle (patch-turtles ,patch))) - (setf (patch-turtles ,new-patch) (nconc (patch-turtles ,new-patch) (list ,turtle)))))))) + (setf (patch-turtles ,new-patch) (nconc (patch-turtles ,new-patch) (list ,turtle)))) + ,retn))))