diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-02-13 20:28:46 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-02-13 20:28:46 +0000 |
| commit | f1682dc2a3205d1bfbb9ae2011de9c8da7dd6d03 (patch) | |
| tree | 41863c6f4191778adcd2bb45d2c13c3dfb4fea77 /lib/logic.moon | |
| parent | add launchcontrol midi (diff) | |
| download | alive-f1682dc2a3205d1bfbb9ae2011de9c8da7dd6d03.tar.gz alive-f1682dc2a3205d1bfbb9ae2011de9c8da7dd6d03.zip | |
add ==, mod
Diffstat (limited to 'lib/logic.moon')
| -rw-r--r-- | lib/logic.moon | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/logic.moon b/lib/logic.moon index 27fa0da..1c274dd 100644 --- a/lib/logic.moon +++ b/lib/logic.moon @@ -10,6 +10,19 @@ class BinOp extends Op for child in *@children child\update dt +class eq extends BinOp + @doc: "(eq a b [c]...) +(== a b [c]...) - check for equality" + + update: (dt) => + super\update dt + + @value = true + val = @children[1]\get! + for child in *@children[2,] + @value and= val == child\get! + + class and_ extends BinOp @doc: "(and a b [c]...) - AND values" @@ -57,6 +70,8 @@ class bool extends Op true { + '==': eq + :eq and: and_ or: or_ not: not_ |
