diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-02-10 17:51:24 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-02-10 17:51:24 +0000 |
| commit | 6c18ffdcc493bce6bfec4f5e64453ec7d6140253 (patch) | |
| tree | bd3f3fe647a8ad66d7c77c918174a464389a70f3 /lib/math.moon | |
| parent | closures (diff) | |
| download | alive-6c18ffdcc493bce6bfec4f5e64453ec7d6140253.tar.gz alive-6c18ffdcc493bce6bfec4f5e64453ec7d6140253.zip | |
add doc, import, import*, defn
Diffstat (limited to 'lib/math.moon')
| -rw-r--r-- | lib/math.moon | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/math.moon b/lib/math.moon index ca7321c..35ee4de 100644 --- a/lib/math.moon +++ b/lib/math.moon @@ -11,6 +11,9 @@ class BinOp extends Op child\update dt class add extends BinOp + @doc: "(+ a b [c]...) +(add a b [c]...) - add values" + update: (dt) => super\update dt @@ -19,6 +22,11 @@ class add extends BinOp @value += child\get! class sub extends BinOp + @doc: "(- a b [c]...) +(sub a b [c]...) - subtract values + +subtracts all other arguments from a" + update: (dt) => super\update dt @@ -27,6 +35,9 @@ class sub extends BinOp @value -= child\get! class mul extends BinOp + @doc: "(* a b [c]...) +(mul a b [c]...) - multiply values" + update: (dt) => super\update dt @@ -35,6 +46,11 @@ class mul extends BinOp @value *= child\get! class div extends BinOp + @doc: "(/ a b [c]...) +(div a b [c]...) - divide values + +divides a by all other arguments" + update: (dt) => super\update dt |
