about summary refs log tree commit diff stats
path: root/070table.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-31 21:59:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-31 21:59:47 -0700
commitcdb9fbee922225a4b2db37cb9470403e45a569b7 (patch)
tree77b64b03d32c34da9f86410d698175816d89c3d0 /070table.mu
parent88b8d6124e199a61c302e4f7b826fbc991410076 (diff)
downloadmu-cdb9fbee922225a4b2db37cb9470403e45a569b7.tar.gz
3616
Diffstat (limited to '070table.mu')
-rw-r--r--070table.mu16
1 files changed, 8 insertions, 8 deletions
diff --git a/070table.mu b/070table.mu
index 1b3d5fd3..d567475c 100644
--- a/070table.mu
+++ b/070table.mu
@@ -62,14 +62,6 @@ def put-index table:&:table:_key:_value, key:_key, value:_value -> table:&:table
   *table-data <- put-index *table-data, hash-key, new-row
 ]
 
-def abs n:num -> result:num [
-  local-scope
-  load-ingredients
-  positive?:bool <- greater-or-equal n, 0
-  return-if positive?, n
-  result <- multiply n, -1
-]
-
 def index table:&:table:_key:_value, key:_key -> result:_value [
   local-scope
   load-ingredients
@@ -84,3 +76,11 @@ def index table:&:table:_key:_value, key:_key -> result:_value [
   assert occupied?, [can't handle missing elements yet]
   result <- get x, value:offset
 ]
+
+def abs n:num -> result:num [
+  local-scope
+  load-ingredients
+  positive?:bool <- greater-or-equal n, 0
+  return-if positive?, n
+  result <- multiply n, -1
+]