about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-08-26 22:05:30 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-08-26 22:05:30 -0700
commit3561e8513d9f7cf94ad66640b153e0b4287c39a8 (patch)
tree3073b697b876afee906ceb1a8d1f63c3fb9d04d1
parent92819aa5e3761c356f4ed2f13b5ab18d51895f7d (diff)
downloadmu-3561e8513d9f7cf94ad66640b153e0b4287c39a8.tar.gz
79 - purge unnecessary macros
Noob mistake.
-rw-r--r--mu.arc40
1 files changed, 18 insertions, 22 deletions
diff --git a/mu.arc b/mu.arc
index 0bb664c1..5d8b5b97 100644
--- a/mu.arc
+++ b/mu.arc
@@ -63,11 +63,10 @@
 (defextend sz (typename) (isa typename 'sym)
   types*.typename!size)
 
-(mac addr (loc)
-  `(let loc@ ,loc
-     (if (pos 'deref (metadata loc@))
-       (memory* (v loc@))
-       (v loc@))))
+(def addr (loc)
+  (if (pos 'deref (metadata loc))
+    (memory* (v loc))
+    (v loc)))
 
 (def addrs (n sz)
   (accum yield
@@ -75,24 +74,21 @@
       (yield n)
       (++ n))))
 
-(mac m (loc)  ; read memory, respecting metadata
-  `(let loc@ ,loc
-;?      (prn "m " loc@ sz.loc@)
-     (if (is 1 sz.loc@)
-       (memory* (addr loc@))
-       (annotate 'record
-                 (map memory* (addrs (addr loc@) sz.loc@))))))
+(def m (loc)  ; read memory, respecting metadata
+;?   (prn "m " loc sz.loc)
+  (if (is 1 sz.loc)
+    (memory* (addr loc))
+    (annotate 'record
+              (map memory* (addrs (addr loc) sz.loc)))))
 
-(mac setm (loc val)  ; set memory, respecting metadata
-  `(with (loc@ ,loc
-          val@ ,val)
-;?      (prn "setm " loc@ " " val@)
-     (assert sz.loc@)
-     (if (is 1 sz.loc@)
-       (= (memory* (addr loc@)) val@)
-       (each (dest@ src@) (zip (addrs (addr loc@) sz.loc@)
-                               (rep val@))
-         (= (memory* dest@) src@)))))
+(def setm (loc val)  ; set memory, respecting metadata
+;?   (prn "setm " loc " " val)
+  (assert sz.loc)
+  (if (is 1 sz.loc)
+    (= (memory* addr.loc) val)
+    (each (dest src) (zip (addrs addr.loc sz.loc)
+                          (rep val))
+      (= (memory* dest) src))))
 
 (def array-len (operand)
   (m `(,v.operand integer)))