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-10-31 15:21:07 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-10-31 15:21:07 -0700
commit40418ad4043eb254d9f2bf3c2307444babae95ae (patch)
tree972fdf01d1dc4a7af51e0a36df272cf1ea3a4670 /mu.arc.t
parent7946c901c7903596b216472f9cdbe9ae381027c7 (diff)
downloadmu-40418ad4043eb254d9f2bf3c2307444babae95ae.tar.gz
185 - make sure functions call by value
This becomes important in the presence of scopes.
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index eb226398..a38ddc37 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -947,6 +947,20 @@
   (prn "F - function with optional second arg"))
 ;? (quit)
 
+(reset)
+(new-trace "new-fn-arg-by-value")
+(add-fns
+  '((test1
+      ((1 integer) <- copy (0 literal))
+      ((2 integer) <- arg))
+    (main
+      ((1 integer) <- copy (34 literal))
+      (test1 (1 integer)))))
+(run 'main)
+;? (prn memory*)
+(if (~iso memory* (obj 1 0  2 34))
+  (prn "F - 'arg' passes by value"))
+
 ; how should errors be handled? will be unclear until we support concurrency and routine trees.
 
 (reset)