diff options
| -rw-r--r-- | alv/base/op.moon | 1 | ||||
| -rw-r--r-- | alv/builtins.moon | 5 |
2 files changed, 2 insertions, 4 deletions
diff --git a/alv/base/op.moon b/alv/base/op.moon index a6b0947..bda30f5 100644 --- a/alv/base/op.moon +++ b/alv/base/op.moon @@ -170,6 +170,7 @@ class Op -- @tparam Type type -- @tparam[opt] any val initial value setup_out: (metatype, type, val) => + metatype = '~' if metatype == '=' if @out and @out.type == type and @out.metatype == metatype -- we can just keep it. do nothing. return false diff --git a/alv/builtins.moon b/alv/builtins.moon index 2e86d4c..9203064 100644 --- a/alv/builtins.moon +++ b/alv/builtins.moon @@ -354,15 +354,12 @@ switch_ = Constant.meta if i\type! == T.bang if i\dirty! @state += 1 - while @state >= #values - @state -= #values - @state + @state = @state % (#values) else @state = switch i! when true then 0 when false then 1 else (math.floor i!) % #values - @state @out\set if v = values[@state + 1] then v! |
