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-11 10:09:41 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-10-11 10:09:59 -0700
commit639fd2fb54fde7dae2444678b1ecec6c8b376e07 (patch)
tree3a1b111c8c2a3aa2ab0020aa5e73f1168453f4bc /mu.arc.t
parentb1e7d8617afce3d0fe9c27ebe4e0168a468beb28 (diff)
downloadmu-639fd2fb54fde7dae2444678b1ecec6c8b376e07.tar.gz
130 - build maybe-coerce in mu
This is more likely to be right. But the limitations of symbolic
locations are starting to be a drag. Time to build lexical scope.
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t7
1 files changed, 4 insertions, 3 deletions
diff --git a/mu.arc.t b/mu.arc.t
index a784709d..a6ced345 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -138,7 +138,7 @@
               integer-integer-pair (obj size 2  record t  elems '(integer integer))
               integer-point-pair (obj size 2  record t  elems '(integer integer-integer-pair))
               ; tagged-values are the foundation of dynamic types
-              tagged-value (obj size 2  record t  elems '(type address))
+              tagged-value (obj size 2  record t  elems '(type location))
               )))
 
 ; Our language is assembly-like in that functions consist of series of
@@ -606,14 +606,15 @@
 
 (reset)
 (new-trace "tagged-value")
+;? (set dump-trace*)
 (add-fns
   '((test1
       ((1 type) <- copy (integer-address literal))
-      ((2 integer-address) <- copy (3 literal))
+      ((2 integer-address) <- copy (34 literal))
       ((3 integer-address) (4 boolean) <- maybe-coerce (1 tagged-value) (integer-address literal)))))
 (run 'test1)
 ;? (prn memory*)
-(if (~iso memory* (obj 1 'integer-address  2 3  3 3  4 t))
+(if (or (~is memory*.3 34) (~is memory*.4 t))
   (prn "F - 'maybe-coerce' copies value only if type tag matches"))
 
 ; Just like the table of types is centralized, functions are conceptualized as