about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-29 12:33:57 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-29 12:40:29 -0800
commite2a5ae322ce5fec5b798a8c74eb0e72210934de1 (patch)
tree8c68c74c0d89d007db552aaa1aabd79d2cace8c7 /mu.arc.t
parentb96d34f6f613789537e65973f0048dd3ca7681de (diff)
downloadmu-e2a5ae322ce5fec5b798a8c74eb0e72210934de1.tar.gz
676 - allow routines to share *names* for locals
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index cbf7c6a2..af4642a4 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -2252,6 +2252,32 @@
   (prn "F - /names to name variables in outer spaces"))
 ;? (quit)
 
+(reset)
+(new-trace "default-space-shared-with-names")
+(add-code
+  '((function f [
+      (default-space:space-address <- new space:literal 30:literal)
+      (x:integer <- copy 3:literal)
+      (y:integer <- copy 4:literal)
+      (reply default-space:space-address)
+     ])
+    (function g [
+      (default-space:space-address/names:f <- next-input)
+      (y:integer <- add y:integer 1:literal)
+      (x:integer <- add x:integer 2:literal)
+      (reply x:integer y:integer)
+     ])
+    (function main [
+      (1:space-address <- f)
+      (2:integer 3:integer <- g 1:space-address)
+     ])))
+(run 'main)
+(each routine completed-routines*
+  (aif rep.routine!error (prn "error - " it)))
+(when (or (~is memory*.2 5)
+          (~is memory*.3 5))
+  (prn "F - override names for the default space"))
+
 )  ; section 20
 
 (section 100