about summary refs log tree commit diff stats
path: root/shell/global.mu
diff options
context:
space:
mode:
Diffstat (limited to 'shell/global.mu')
-rw-r--r--shell/global.mu13
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/global.mu b/shell/global.mu
index c3df463e..9bc2aff4 100644
--- a/shell/global.mu
+++ b/shell/global.mu
@@ -48,7 +48,9 @@ fn initialize-globals _self: (addr global-table) {
   # for streams
   append-primitive self, "stream"
   append-primitive self, "write"
+  # misc
   append-primitive self, "abort"
+  append-primitive self, "life"
   # keep sync'd with render-primitives
 }
 
@@ -595,6 +597,13 @@ fn apply-primitive _f: (addr cell), args-ah: (addr handle cell), out: (addr hand
     apply-abort args-ah, out, trace
     return
   }
+  {
+    var life?/eax: boolean <- string-equal? f-name, "life"
+    compare life?, 0/false
+    break-if-=
+    apply-life args-ah, out, trace
+    return
+  }
   abort "unknown primitive function"
 }
 
@@ -1636,6 +1645,10 @@ fn apply-abort _args-ah: (addr handle cell), out: (addr handle cell), trace: (ad
   abort "aa"
 }
 
+fn apply-life _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) {
+  life
+}
+
 fn apply-columns _args-ah: (addr handle cell), out: (addr handle cell), trace: (addr trace) {
   trace-text trace, "eval", "apply columns"
   var args-ah/eax: (addr handle cell) <- copy _args-ah