diff options
| author | s-ol <s+removethis@s-ol.nu> | 2022-02-04 16:13:20 +0000 |
|---|---|---|
| committer | s-ol <s+removethis@s-ol.nu> | 2025-03-02 14:24:49 +0000 |
| commit | 4135de8342e099bbcf53954cbba8f4928af8f329 (patch) | |
| tree | 3912cda7d30d57b0e8b7182f7f08dbc278639571 /alv | |
| parent | lib: use Op:update_out (diff) | |
| download | alive-4135de8342e099bbcf53954cbba8f4928af8f329.tar.gz alive-4135de8342e099bbcf53954cbba8f4928af8f329.zip | |
rename Op:update_out → setup_out
Diffstat (limited to 'alv')
| -rw-r--r-- | alv/base/op.moon | 2 | ||||
| -rw-r--r-- | alv/base/pureop.moon | 2 | ||||
| -rw-r--r-- | alv/builtins.moon | 8 |
3 files changed, 6 insertions, 6 deletions
diff --git a/alv/base/op.moon b/alv/base/op.moon index 4153a52..a6b0947 100644 --- a/alv/base/op.moon +++ b/alv/base/op.moon @@ -169,7 +169,7 @@ class Op -- @tparam string metatype (one of `!` or `~`) -- @tparam Type type -- @tparam[opt] any val initial value - update_out: (metatype, type, val) => + setup_out: (metatype, type, val) => if @out and @out.type == type and @out.metatype == metatype -- we can just keep it. do nothing. return false diff --git a/alv/base/pureop.moon b/alv/base/pureop.moon index 449519a..a5c146c 100644 --- a/alv/base/pureop.moon +++ b/alv/base/pureop.moon @@ -57,7 +57,7 @@ class PureOp extends Op if typ assert (ancestor typ.__class) == Type, "not a type: #{typ}" metatype = if trigger then '!' else '~' - @update_out metatype, typ + @setup_out metatype, typ map_fn = if trigger then hot_if_trigger trigger else Input.hot inputs = deep_map args, map_fn diff --git a/alv/builtins.moon b/alv/builtins.moon index 622a59e..2e86d4c 100644 --- a/alv/builtins.moon +++ b/alv/builtins.moon @@ -339,7 +339,7 @@ switch_ = Constant.meta { i, values } = pattern\match inputs val1 = values[1] - @update_out val1.result.metatype, val1.result.type + @setup_out val1.result.metatype, val1.result.type if i\type! == T.bang @state or= 1 @@ -462,7 +462,7 @@ Since ~-streams cannot be emtpy, specifying an `initial` value is necessary." super event: Input.hot event - @update_out '~', event\type!, initial.result! + @setup_out '~', event\type!, initial.result! tick: => @out\set @inputs.event! @@ -492,7 +492,7 @@ to_evt = Constant.meta else super sig: Input.hot sig_ - @update_out '!', @inputs.sig\type! + @setup_out '!', @inputs.sig\type! tick: (setup) => return if setup @@ -514,7 +514,7 @@ In case of collisions, the event that comes first in the argument list wins." setup: (inputs) => values = pattern\match inputs super [Input.hot v for v in *values] - @update_out '!', @inputs[1]\type! + @setup_out '!', @inputs[1]\type! tick: => for input in *@inputs |
