about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-07-06 02:19:32 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-07-06 02:20:14 -0700
commit4363daba1f60032a117ffd1d0c34d31120e578ac (patch)
tree17e11a7afe8de7792974a6458731e5233a6508ee /mu.arc.t
parent52cbb739921116ece71bbcde1a02bed8cae9c1db (diff)
downloadmu-4363daba1f60032a117ffd1d0c34d31120e578ac.tar.gz
5 - compound functions now take args
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t19
1 files changed, 19 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index fd9c0946..6f51cda9 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -36,3 +36,22 @@
 ;? (prn memory*)
 (if (~iso memory* (obj 1 1  2 3  3 4))
   (prn "F - early return works"))
+
+(clear)
+(add-fns
+  '((add-fn
+      (4 <- read)
+      (5 <- read)
+      (3 <- add 4 5)
+      (return)
+      (4 <- loadi 34))
+    (main
+      (1 <- loadi 1)
+      (2 <- loadi 3)
+      (add-fn 1 2))))
+(run function*!main)
+;? (prn memory*)
+(if (~iso memory* (obj 1 1  2 3  3 4
+                       ; add-fn's temporaries
+                       4 1  5 3))
+  (prn "F - parameterized compound fn"))