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-11-03 22:34:58 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-11-03 22:37:44 -0800
commit83d275f9a8c5e37bdff7f0b7c2f92c9d04fa061d (patch)
treee94747bdf13e084db866cbce6d25dcd5f09a86f0 /mu.arc.t
parent5be49b35fd7f3edfe2aff29abff35f5b3af8cbbf (diff)
downloadmu-83d275f9a8c5e37bdff7f0b7c2f92c9d04fa061d.tar.gz
215 - allow record fields to be named
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t21
1 files changed, 21 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 14d1bced..e0bc6bd5 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1309,6 +1309,27 @@
             ((z fn) <- add (1 integer) (2 integer))))
   (prn "F - convert-names never renames nil"))
 
+(reset)
+(new-trace "convert-names-record-fields")
+(if (~iso (convert-names
+            '(((x integer) <- get (34 integer-boolean-pair) (bool offset))))
+          '(((1 integer) <- get (34 integer-boolean-pair) (1 offset))))
+  (prn "F - convert-names replaces record field offsets"))
+
+(reset)
+(new-trace "convert-names-record-fields-ambiguous")
+(if (errsafe (convert-names
+               '(((bool boolean) <- copy (t literal))
+                 ((x integer) <- get (34 integer-boolean-pair) (bool offset)))))
+  (prn "F - convert-names doesn't allow offsets and variables with the same name in a function"))
+
+(reset)
+(new-trace "convert-names-record-fields-ambiguous-2")
+(if (errsafe (convert-names
+               '(((x integer) <- get (34 integer-boolean-pair) (bool offset))
+                 ((bool boolean) <- copy (t literal)))))
+  (prn "F - convert-names doesn't allow offsets and variables with the same name in a function - 2"))
+
 ; A rudimentary memory allocator. Eventually we want to write this in mu.
 ;
 ; No deallocation yet; let's see how much code we can build in mu before we