about summary refs log tree commit diff stats
path: root/shell
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-07-19 20:08:30 -0700
committerKartik K. Agaram <vc@akkartik.com>2021-07-19 20:08:30 -0700
commit1eb1ac81ea0eb5e8b10153a70f4948ac92f1f14d (patch)
treeffe4434a57a81c9bebb63b73982193cc7cc37441 /shell
parent4b5a6f6c30f4c95fc339b54a9d0a70e685b18e7c (diff)
downloadmu-1eb1ac81ea0eb5e8b10153a70f4948ac92f1f14d.tar.gz
.
Diffstat (limited to 'shell')
-rw-r--r--shell/environment.mu4
-rw-r--r--shell/primitives.mu9
2 files changed, 3 insertions, 10 deletions
diff --git a/shell/environment.mu b/shell/environment.mu
index 688590dd..0816f41b 100644
--- a/shell/environment.mu
+++ b/shell/environment.mu
@@ -283,9 +283,7 @@ fn edit-environment _self: (addr environment), key: grapheme, data-disk: (addr d
         var global-data/eax: (addr array global) <- lookup *global-data-ah
         var curr-offset/ebx: (offset global) <- compute-offset global-data, curr-index
         var curr/ebx: (addr global) <- index global-data, curr-offset
-        var curr-value-ah/eax: (addr handle cell) <- get curr, value
-        var curr-value/eax: (addr cell) <- lookup *curr-value-ah
-        var primitive?/eax: boolean <- primitive? curr-value
+        var primitive?/eax: boolean <- primitive-global? curr
         compare primitive?, 0/false
         break-if-=
         var go-modal-error-ah/eax: (addr handle array byte) <- get self, go-modal-error
diff --git a/shell/primitives.mu b/shell/primitives.mu
index 66bc3786..b7f46a6e 100644
--- a/shell/primitives.mu
+++ b/shell/primitives.mu
@@ -179,13 +179,8 @@ fn primitive-global? _x: (addr global) -> _/eax: boolean {
     break-if-!=
     return 0/false
   }
-  {
-    var value-type/eax: (addr int) <- get value, type
-    compare *value-type, 4/primitive
-    break-if-=
-    return 0/false
-  }
-  return 1/true
+  var primitive?/eax: boolean <- primitive? value
+  return primitive?
 }
 
 fn append-primitive _self: (addr global-table), name: (addr array byte) {