* tram.el (tram-compose-&&): Expand macro `closure-call'.
authorueno <ueno>
Wed, 16 Aug 2000 17:21:26 +0000 (17:21 +0000)
committerueno <ueno>
Wed, 16 Aug 2000 17:21:26 +0000 (17:21 +0000)
(tram-compose-||): Ditto.

tram.el

diff --git a/tram.el b/tram.el
index 3a2f61c..5bcfee5 100644 (file)
--- a/tram.el
+++ b/tram.el
 (defun tram-compose-&& (left right)
   "Multiplicative combinator which composes LEFT and RIGHT operations."
   `(lambda (trans)
-     (let ((next (closure-call ',left trans)))
-       (closure-call ',right next))))
+     (let ((next
+           ,(macroexpand
+             (if (functionp left)
+                 `(closure-call #',left trans)
+               `(closure-call ',left trans)))))
+       ,(macroexpand
+        (if (functionp right)
+            `(closure-call #',right next)
+          `(closure-call ',right next))))))
 
 (defun tram-compose-|| (left right)
   "Additive combinator which composes LEFT and RIGHT operations."
      (let (next error)
        (setq error
             (catch (tram-stream-error-name trans)
-              (setq next (closure-call ',left trans))
+              (setq next
+                    ,(macroexpand
+                      (if (functionp left)
+                          `(closure-call #',left trans)
+                        `(closure-call ',left trans))))
               nil))
        (if error
-          (closure-call ',right trans)
+          ,(macroexpand
+            (if (functionp right)
+                `(closure-call #',right next)
+              `(closure-call ',right next)))
         next))))
 
 (defun tram-fold-left (function accu sequence)