From cdb9fbee922225a4b2db37cb9470403e45a569b7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 31 Oct 2016 21:59:47 -0700 Subject: 3616 --- 070table.mu | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to '070table.mu') 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 +] -- cgit 1.4.1-2-gfad0