From f38c2a1502648b0be16fc2e984420886cf64cdee Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 10 Apr 2021 22:38:02 -0700 Subject: . --- shell/evaluate.mu | 4 ++-- shell/global.mu | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'shell') diff --git a/shell/evaluate.mu b/shell/evaluate.mu index ba13b494..62e5f885 100644 --- a/shell/evaluate.mu +++ b/shell/evaluate.mu @@ -545,7 +545,7 @@ fn test-lookup-symbol-in-globals { var result-type/edx: (addr int) <- get result, type check-ints-equal *result-type, 4/primitive-function, "F - test-lookup-symbol-in-globals/0" var result-value/eax: (addr int) <- get result, index-data - check-ints-equal *result-value, 1/add, "F - test-lookup-symbol-in-globals/1" + check-ints-equal *result-value, 2/add, "F - test-lookup-symbol-in-globals/1" } fn car _in: (addr cell), out: (addr handle cell), trace: (addr trace) { @@ -827,7 +827,7 @@ fn test-evaluate-primitive-function { var result-type/edx: (addr int) <- get result, type check-ints-equal *result-type, 4/primitive-function, "F - test-evaluate-primitive-function/0" var result-value/eax: (addr int) <- get result, index-data - check-ints-equal *result-value, 1/add, "F - test-evaluate-primitive-function/1" + check-ints-equal *result-value, 2/add, "F - test-evaluate-primitive-function/1" } fn test-evaluate-primitive-function-call { diff --git a/shell/global.mu b/shell/global.mu index 22b38764..1c0dd506 100644 --- a/shell/global.mu +++ b/shell/global.mu @@ -12,16 +12,21 @@ fn initialize-globals _self: (addr global-table) { var self/esi: (addr global-table) <- copy _self var data-ah/eax: (addr handle array global) <- get self, data populate data-ah, 0x10 + # generic + append-primitive self, "=" + # for numbers append-primitive self, "+" append-primitive self, "-" append-primitive self, "*" append-primitive self, "/" append-primitive self, "sqrt" + # for pairs append-primitive self, "car" append-primitive self, "cdr" append-primitive self, "cons" - append-primitive self, "=" + # for screens append-primitive self, "print" + # for keyboards append-primitive self, "key" } -- cgit 1.4.1-2-gfad0