98 - getting sick of loading literals before use
This commit is contained in:
parent
b982e863fa
commit
186e188402
11
mu.arc
11
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)
|
||||
|
|
8
mu.arc.t
8
mu.arc.t
|
@ -172,6 +172,14 @@
|
|||
4 1 5 3 6 4))
|
||||
(prn "F - 'reply' permits a function to return multiple values at once"))
|
||||
|
||||
(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
|
||||
|
|
Loading…
Reference in New Issue