about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-10-31 16:22:21 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-10-31 16:22:30 -0700
commitd9b215437a93569ecb850de8897fef8df76e1a8c (patch)
tree63d769c348aee900b56b91fd097d1ba01062de65 /mu.arc
parent32f282b4ae6f78f5b7ef33cde0eb167cabd38a8b (diff)
downloadmu-d9b215437a93569ecb850de8897fef8df76e1a8c.tar.gz
188 - new op: 'prepare-reply'
It's needed to allow 'defer' to execute statements on 'reply' without
touching the results.
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc14
1 files changed, 10 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc
index 7ac37993..87c84bb0 100644
--- a/mu.arc
+++ b/mu.arc
@@ -489,12 +489,18 @@
                     (if (len> caller-args.routine* idx)
                       (list caller-args.routine*.idx t)
                       (list nil nil)))
+                prepare-reply
+                  (= results.routine*
+                     (accum yield
+                       (each a arg
+                         (yield (m a)))))
                 reply
                   (do
-                      (= results.routine*
-                         (accum yield
-                           (each a arg
-                             (yield (m a)))))
+                      (when arg
+                        (= results.routine*
+                           (accum yield
+                             (each a arg
+                               (yield (m a))))))
                       (let results results.routine*
                         (pop-stack routine*)
                         (if empty.routine* (return ninstrs))