about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2020-10-05 21:32:45 -0700
committerKartik Agaram <vc@akkartik.com>2020-10-05 21:32:45 -0700
commit88e23b97dfbe275296f3722b1ce589aee3fc0af2 (patch)
treece8bef287ddb1085454319551ba57030d0dc3420
parentc2844535f38c4eeb3b822d83947d495e716ab580 (diff)
downloadmu-88e23b97dfbe275296f3722b1ce589aee3fc0af2.tar.gz
6965
-rw-r--r--apps/tile/data.mu8
-rw-r--r--apps/tile/environment.mu30
-rw-r--r--apps/tile/rpn.mu10
3 files changed, 24 insertions, 24 deletions
diff --git a/apps/tile/data.mu b/apps/tile/data.mu
index aac2dc6d..4e82bb65 100644
--- a/apps/tile/data.mu
+++ b/apps/tile/data.mu
@@ -1,5 +1,5 @@
 type program {
-  defs: (handle function)
+  functions: (handle function)
   sandboxes: (handle sandbox)
 }
 
@@ -61,8 +61,8 @@ type result {
 
 fn initialize-program _program: (addr program) {
   var program/esi: (addr program) <- copy _program
-  var defs/eax: (addr handle function) <- get program, defs
-  create-primitive-defs defs
+  var functions/eax: (addr handle function) <- get program, functions
+  create-primitive-functions functions
   var sandbox-ah/eax: (addr handle sandbox) <- get program, sandboxes
   allocate sandbox-ah
   var sandbox/eax: (addr sandbox) <- lookup *sandbox-ah
@@ -95,7 +95,7 @@ fn initialize-line _line: (addr line), out: (addr handle word) {
   initialize-word word
 }
 
-fn create-primitive-defs _self: (addr handle function) {
+fn create-primitive-functions _self: (addr handle function) {
   # x 2* = x 2 *
   var self/esi: (addr handle function) <- copy _self
   allocate self
diff --git a/apps/tile/environment.mu b/apps/tile/environment.mu
index a544449c..132e5151 100644
--- a/apps/tile/environment.mu
+++ b/apps/tile/environment.mu
@@ -165,15 +165,15 @@ fn evaluate-environment _env: (addr environment), stack: (addr value-stack) {
   var program-ah/eax: (addr handle program) <- get env, program
   var _program/eax: (addr program) <- lookup *program-ah
   var program/esi: (addr program) <- copy _program
-  # defs
-  var defs/edx: (addr handle function) <- get program, defs
+  # functions
+  var functions/edx: (addr handle function) <- get program, functions
   # line
   var sandbox-ah/esi: (addr handle sandbox) <- get program, sandboxes
   var sandbox/eax: (addr sandbox) <- lookup *sandbox-ah
   var line-ah/eax: (addr handle line) <- get sandbox, data
   var _line/eax: (addr line) <- lookup *line-ah
   var line/esi: (addr line) <- copy _line
-  evaluate defs, 0, line, 0, stack
+  evaluate functions, 0, line, 0, stack
 }
 
 fn render _env: (addr environment) {
@@ -191,15 +191,15 @@ fn render _env: (addr environment) {
   var program-ah/eax: (addr handle program) <- get env, program
   var _program/eax: (addr program) <- lookup *program-ah
   var program/esi: (addr program) <- copy _program
-  # defs
-  var defs/edx: (addr handle function) <- get program, defs
+  # functions
+  var functions/edx: (addr handle function) <- get program, functions
   # sandbox
   var sandbox-ah/eax: (addr handle sandbox) <- get program, sandboxes
   var sandbox/eax: (addr sandbox) <- lookup *sandbox-ah
-  render-sandbox screen, defs, 0, sandbox, 3, repl-col
+  render-sandbox screen, functions, 0, sandbox, 3, repl-col
 }
 
-fn render-sandbox screen: (addr screen), defs: (addr handle function), bindings: (addr table), _sandbox: (addr sandbox), top-row: int, left-col: int {
+fn render-sandbox screen: (addr screen), functions: (addr handle function), bindings: (addr table), _sandbox: (addr sandbox), top-row: int, left-col: int {
   var sandbox/esi: (addr sandbox) <- copy _sandbox
   # line
   var line-ah/eax: (addr handle line) <- get sandbox, data
@@ -213,11 +213,11 @@ fn render-sandbox screen: (addr screen), defs: (addr handle function), bindings:
   var cursor-col: int
   var cursor-col-a/eax: (addr int) <- address cursor-col
   #
-  var dummy/ecx: int <- render-line screen, defs, 0, line, 3, left-col, cursor-word, cursor-col-a  # input-row=3
+  var dummy/ecx: int <- render-line screen, functions, 0, line, 3, left-col, cursor-word, cursor-col-a  # input-row=3
   move-cursor screen, 3, cursor-col  # input-row
 }
 
-fn render-line screen: (addr screen), defs: (addr handle function), bindings: (addr table), _line: (addr line), top-row: int, left-col: int, cursor-word: (addr word), cursor-col-a: (addr int) -> right-col/ecx: int {
+fn render-line screen: (addr screen), functions: (addr handle function), bindings: (addr table), _line: (addr line), top-row: int, left-col: int, cursor-word: (addr word), cursor-col-a: (addr int) -> right-col/ecx: int {
   # curr-word
   var line/esi: (addr line) <- copy _line
   var first-word-ah/eax: (addr handle word) <- get line, data
@@ -245,7 +245,7 @@ fn render-line screen: (addr screen), defs: (addr handle function), bindings: (a
         emit-word curr-word, curr-stream
         var callee-h: (handle function)
         var callee-ah/eax: (addr handle function) <- address callee-h
-        find-function defs, curr-stream, callee-ah
+        find-function functions, curr-stream, callee-ah
         var _callee/eax: (addr function) <- lookup *callee-ah
         callee <- copy _callee
         compare callee, 0
@@ -268,7 +268,7 @@ fn render-line screen: (addr screen), defs: (addr handle function), bindings: (a
         var prev-word/eax: (addr word) <- lookup *prev-word-ah
         compare prev-word, 0
         break-if-=
-        evaluate defs, bindings, line, prev-word, stack
+        evaluate functions, bindings, line, prev-word, stack
       }
       # construct new bindings
       var callee-bindings-storage: table
@@ -279,7 +279,7 @@ fn render-line screen: (addr screen), defs: (addr handle function), bindings: (a
       var callee-body-ah/eax: (addr handle line) <- get callee, body
       var callee-body/eax: (addr line) <- lookup *callee-body-ah
       # - render subsidiary stack
-      curr-col <- render-line screen, defs, callee-bindings, callee-body, top-row, curr-col, cursor-word, cursor-col-a
+      curr-col <- render-line screen, functions, callee-bindings, callee-body, top-row, curr-col, cursor-word, cursor-col-a
       #
       move-cursor screen, top-row, curr-col
       print-code-point screen, 0x21d7  # ⇗
@@ -295,7 +295,7 @@ fn render-line screen: (addr screen), defs: (addr handle function), bindings: (a
       reset-formatting screen
     add-to top-row, 1
     # now render main column
-    curr-col <- render-column screen, defs, bindings, line, curr-word, top-row, curr-col, cursor-word, cursor-col-a
+    curr-col <- render-column screen, functions, bindings, line, curr-word, top-row, curr-col, cursor-word, cursor-col-a
     var next-word-ah/edx: (addr handle word) <- get curr-word, next
     curr-word <- lookup *next-word-ah
     word-index <- increment
@@ -313,7 +313,7 @@ fn render-line screen: (addr screen), defs: (addr handle function), bindings: (a
 # - Return the farthest column written.
 # - If final-word is same as cursor-word, do some additional computation to set
 #   cursor-col-a.
-fn render-column screen: (addr screen), defs: (addr handle function), bindings: (addr table), scratch: (addr line), final-word: (addr word), top-row: int, left-col: int, cursor-word: (addr word), cursor-col-a: (addr int) -> right-col/ecx: int {
+fn render-column screen: (addr screen), functions: (addr handle function), bindings: (addr table), scratch: (addr line), final-word: (addr word), top-row: int, left-col: int, cursor-word: (addr word), cursor-col-a: (addr int) -> right-col/ecx: int {
   var max-width/ecx: int <- copy 0
   {
     # indent stack
@@ -323,7 +323,7 @@ fn render-column screen: (addr screen), defs: (addr handle function), bindings:
     var stack: value-stack
     var stack-addr/edi: (addr value-stack) <- address stack
     initialize-value-stack stack-addr, 0x10  # max-words
-    evaluate defs, bindings, scratch, final-word, stack-addr
+    evaluate functions, bindings, scratch, final-word, stack-addr
     # render stack
     var curr-row/edx: int <- copy top-row
     curr-row <- add 3  # stack-margin-top
diff --git a/apps/tile/rpn.mu b/apps/tile/rpn.mu
index 96c5f8d6..a1ce7ec8 100644
--- a/apps/tile/rpn.mu
+++ b/apps/tile/rpn.mu
@@ -1,4 +1,4 @@
-fn evaluate defs: (addr handle function), bindings: (addr table), scratch: (addr line), end: (addr word), out: (addr value-stack) {
+fn evaluate functions: (addr handle function), bindings: (addr table), scratch: (addr line), end: (addr word), out: (addr value-stack) {
   var line/eax: (addr line) <- copy scratch
   var word-ah/eax: (addr handle word) <- get line, data
   var curr/eax: (addr word) <- lookup *word-ah
@@ -52,11 +52,11 @@ fn evaluate defs: (addr handle function), bindings: (addr table), scratch: (addr
       {
         var callee-h: (handle function)
         var callee-ah/eax: (addr handle function) <- address callee-h
-        find-function defs, curr-stream, callee-ah
+        find-function functions, curr-stream, callee-ah
         var callee/eax: (addr function) <- lookup *callee-ah
         compare callee, 0
         break-if-=
-        perform-call callee, out, defs
+        perform-call callee, out, functions
         break $evaluate:process-word
       }
       # if it's a name, push its value
@@ -119,7 +119,7 @@ fn find-function first: (addr handle function), name: (addr stream byte), out: (
   }
 }
 
-fn perform-call _callee: (addr function), caller-stack: (addr value-stack), defs: (addr handle function) {
+fn perform-call _callee: (addr function), caller-stack: (addr value-stack), functions: (addr handle function) {
   var callee/ecx: (addr function) <- copy _callee
   # create bindings for args
   var table-storage: table
@@ -134,7 +134,7 @@ fn perform-call _callee: (addr function), caller-stack: (addr value-stack), defs
   var stack/edi: (addr value-stack) <- address stack-storage
   initialize-value-stack stack, 0x10
 #?   print-string-to-real-screen "about to enter recursive eval\n"
-  evaluate defs, table, body, 0, stack
+  evaluate functions, table, body, 0, stack
 #?   print-string-to-real-screen "exited recursive eval\n"
   # stitch result from stack into caller
   var result/eax: int <- pop-int-from-value-stack stack