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-12 10:23:02 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-10-12 10:23:02 -0700
commit89ee18a13effc454fbb4accb094119d5d3398a29 (patch)
treeb5139165a7dfd9b52900bc977cd27ca4318b60ab /mu.arc.t
parent3245570bc74382aabd1d84b5fae7cae91849df4d (diff)
downloadmu-89ee18a13effc454fbb4accb094119d5d3398a29.tar.gz
134 - 'arg' explicitly tells us if an arg was found
Return values can be ignored in mu, in the grand traditions of C programming.
Though library writers can impose their conservatism on callers by returning
the error condition first.
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t15
1 files changed, 15 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 814a9417..9c63d882 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -791,6 +791,21 @@
   (prn "F - missing 'arg' doesn't cause error"))
 ;? (quit)
 
+(reset)
+(new-trace "new-fn-arg-missing-2")
+(add-fns
+  '((test1
+      ((4 integer) <- arg)
+      ((5 integer) (6 boolean) <- arg))
+    (main
+      (test1 (1 literal))
+    )))
+(run 'main)
+;? (prn memory*)
+(if (~iso memory* (obj 4 1  6 t))
+  (prn "F - missing 'arg' sets a second oarg when provided"))
+;? (quit)
+
 ; how should errors be handled? will be unclear until we support concurrency and routine trees.
 
 (reset)