From d8f9b15fd9da8c9ae29ee0b63c4302e5efbde387 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 31 Dec 2018 01:02:46 -0800 Subject: Cleaning up some of the documentation and dead code. --- core/math.nom | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'core/math.nom') diff --git a/core/math.nom b/core/math.nom index adba0e9..04388cb 100644 --- a/core/math.nom +++ b/core/math.nom @@ -72,38 +72,12 @@ externally [all of $items, all $items] all mean: unless $: return (no) return (yes) - -#[all of %items, all %items] all compile to: - unless (%items.type is "List"): - return \(all of %items) - - if ((size of %items) == 0): - return (Lua "true") - - %lua = (Lua "(") - %lua::add [: for % in %items: add (% as lua expr)] joined with " and " - %lua::add ")" - return %lua - [not all of $items, not all $items] all parse as (not (all of $items)) externally [any of $items, any $items] all mean: for $ in $items: if $: return (yes) return (no) - -#[any of %items, any %items] all compile to: - unless (%items.type is "List"): - return \(any of %items) - - if ((size of %items) == 0): - return (Lua "false") - - %lua = (Lua "(") - %lua::add [: for % in %items: add (% as lua expr)] joined with " or " - %lua::add ")" - return %lua - [none of $items, none $items] all parse as (not (any of $items)) # Sum/product @@ -113,36 +87,12 @@ externally [sum of $items, sum $items] all mean: $total += $ return $total -#[sum of %items, sum %items] all compile to: - unless (%items.type is "List"): - return \(sum of %items) - - if ((size of %items) == 0): - return (Lua "0") - - %lua = (Lua "(") - %lua::add [: for % in %items: add (% as lua expr)] joined with " + " - %lua::add ")" - return %lua - externally [product of $items, product $items] all mean: $prod = 1 for $ in $items: $prod *= $ return $prod -#[product of %items, product %items] all compile to: - unless (%items.type is "List"): - return \(product of %items) - - if ((size of %items) == 0): - return (Lua "1") - - %lua = (Lua "(") - %lua::add [: for % in %items: add (% as lua expr)] joined with " * " - %lua::add ")" - return %lua - externally [avg of $items, average of $items] all mean (sum of $items) / (size of $items) -- cgit v1.2.3