git.s-ol.nu alive / 3131b87
builtins: small bugfixes s-ol 6 months ago
2 changed file(s) with 2 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
169169 -- @tparam Type type
170170 -- @tparam[opt] any val initial value
171171 setup_out: (metatype, type, val) =>
172 metatype = '~' if metatype == '='
172173 if @out and @out.type == type and @out.metatype == metatype
173174 -- we can just keep it. do nothing.
174175 return false
353353 if i\type! == T.bang
354354 if i\dirty!
355355 @state += 1
356 while @state >= #values
357 @state -= #values
358 @state
356 @state = @state % (#values)
359357 else
360358 @state = switch i!
361359 when true then 0
362360 when false then 1
363361 else (math.floor i!) % #values
364 @state
365362
366363 @out\set if v = values[@state + 1] then v!
367364