aboutsummaryrefslogtreecommitdiffstats
path: root/lib/math.moon
diff options
context:
space:
mode:
Diffstat (limited to 'lib/math.moon')
-rw-r--r--lib/math.moon6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/math.moon b/lib/math.moon
index 02ba1e1..84e6682 100644
--- a/lib/math.moon
+++ b/lib/math.moon
@@ -1,4 +1,4 @@
-import Op, Value, Input, match from require 'core.base'
+import Op, Value, Error, Input, match from require 'core.base'
unpack or= table.unpack
class ReduceOp extends Op
@@ -71,7 +71,9 @@ func_op = (name, arity, func) ->
setup: (inputs) =>
{ params } = match '*num', inputs
- assert #params == arity, "#{@} needs exactly #{arity} parameters" if arity != '*'
+ if arity != '*'
+ err = Error 'argument', "need exactly #{arity} arguments"
+ assert #params == arity, err
super [Input.value p for p in *params]
tick: => @out\set func unpack @unwrap_all!