diff options
-rw-r--r-- | generic.mu | 5 | ||||
-rw-r--r-- | mu.arc | 5 | ||||
-rw-r--r-- | mu.arc.t | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/generic.mu b/generic.mu index 4486e8bc..1392394a 100644 --- a/generic.mu +++ b/generic.mu @@ -5,7 +5,6 @@ (function factorial [ (default-space:space-address <- new space:literal 30:literal) (n:integer <- input 0:literal) - more-clauses (x:integer <- subtract n:integer 1:literal) (subresult:integer <- factorial x:integer) (result:integer <- multiply subresult:integer n:integer) @@ -13,7 +12,9 @@ ]) ; factorial 0 = 1 -(after factorial/more-clauses [ +(function factorial [ + (default-space:space-address <- new space:literal 30:literal) + (n:integer <- input 0:literal) { begin (zero?:boolean <- equal n:integer 0:literal) (break-unless zero?:boolean) diff --git a/mu.arc b/mu.arc index 4ba2a193..59a16e70 100644 --- a/mu.arc +++ b/mu.arc @@ -815,11 +815,14 @@ (map memory* (addrs addr n))))))) (def setm (loc val) ; set memory, respecting metadata +;? (tr 111) (point return +;? (tr 112) (when (is v.loc 'default-space) (assert (is 1 sizeof.loc) "can't store compounds in default-space @loc") (= rep.routine*!call-stack.0!default-space val) (return)) +;? (tr 120) (assert (isa v.loc 'int) "can't store to non-numeric address (problem in convert-names?)") (trace "setm" loc " <= " val) (with (n (if (isa val 'record) (len rep.val) 1) @@ -904,7 +907,7 @@ (def absolutize (operand) (if (no routine*) operand - (is '_ v.operand) + (in v.operand '_ 'default-space) operand (pos '(raw) metadata.operand) operand diff --git a/mu.arc.t b/mu.arc.t index 5e376ed4..1b378c5a 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -4116,6 +4116,8 @@ (prn "F - 'absolutize' checks against default-space bounds")) (when (~iso '((_ integer)) (absolutize '((_ integer)))) (prn "F - 'absolutize' passes dummy args right through")) +(when (~iso '((default-space integer)) (absolutize '((default-space integer)))) + (prn "F - 'absolutize' passes 'default-space' right through")) (= memory*.20 5) ; pretend array (= rep.routine*!globals 20) ; provide it to routine global |