diff options
-rw-r--r-- | mu.arc | 11 | ||||
-rw-r--r-- | mu.arc.t | 8 |
2 files changed, 15 insertions, 4 deletions
diff --git a/mu.arc b/mu.arc index f1067200..57c69d1f 100644 --- a/mu.arc +++ b/mu.arc @@ -113,10 +113,13 @@ (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))))) + (if (is 'literal ty.loc) + (v loc) + (is 1 sz.loc) + (memory* (addr loc)) + :else + (annotate 'record + (map memory* (addrs (addr loc) sz.loc))))) (def setm (loc val) ; set memory, respecting metadata ;? (prn "setm " loc " " val) diff --git a/mu.arc.t b/mu.arc.t index 3c94d298..f7c9a7a7 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -174,6 +174,14 @@ (reset) (add-fns + '((test1 + ((1 integer) <- add (2 literal) (3 literal))))) +(run 'test1) +(if (~iso memory* (obj 1 5)) + (prn "F - ops can take 'literal' operands (but not return them)")) + +(reset) +(add-fns '((main ((1 integer) <- literal 1) ((2 integer) <- literal 3) |