You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
list - considers the first element if it's a float, stores and outputs it.
the statements are factually wrong.
rather than truncating a list to its first item, it instead distributes the list atoms to the inlets.
in the example ([10.5 12.9 A() this is what happens:
since we only have 2 inlets, the 3rd atom (A) is discarded.
the 2nd atom (12.9) is sent to the 2nd inlet (setting the internal state to 12.9)
the 1st atom (10.5) is sent to the 1st inlet (effectively overwriting the 12.9, and then triggering an output of the current (10.5) value.
in practice this behaviour boils down to the two statements given above.
however, things get more complicated if the list contains symbols as the 1st or 2nd atom.
e.g. [10.5 A( will happily throw an error:
inlet: expected 'float' but got 'symbol'
because the symbol A is sent to the 2nd inlet (which is float-only).
after emitting the error, 10.5 is stored and output.
also, we can do:
[10(
|
[list $1.5 12.9(
|
[float]
which will output 10.5 (without an error), as the 1st atom triggers the symbol method of the object, which in turn converts the literal 10.5 into a number.
and of course we get two errors when sending a [list foo bar( to the object.
i do not want to propose to get into too much detail (as my explanation above), but refer to the common property of distributing list atoms to (cold) inlets.
The text was updated successfully, but these errors were encountered:
thanks for this. I reproduced this mistake from extended/purr misinterpretation of what was going on :/
I guess we just remove the "list" mentioning. Somewhere in the docs we have this information that list are distributed when there is no list method. This can be more evident in something like this --> #96
the current [float-help.pd] states:
and gives an example
[10.5 12.9 A(
in the reference section it states:
the statements are factually wrong.
rather than truncating a list to its first item, it instead distributes the list atoms to the inlets.
in the example (
[10.5 12.9 A(
) this is what happens:A
) is discarded.12.9
) is sent to the 2nd inlet (setting the internal state to12.9
)10.5
) is sent to the 1st inlet (effectively overwriting the12.9
, and then triggering an output of the current (10.5
) value.in practice this behaviour boils down to the two statements given above.
however, things get more complicated if the list contains symbols as the 1st or 2nd atom.
e.g.
[10.5 A(
will happily throw an error:because the symbol
A
is sent to the 2nd inlet (which is float-only).after emitting the error,
10.5
is stored and output.also, we can do:
which will output
10.5
(without an error), as the 1st atom triggers thesymbol
method of the object, which in turn converts the literal10.5
into a number.and of course we get two errors when sending a
[list foo bar(
to the object.i do not want to propose to get into too much detail (as my explanation above), but refer to the common property of distributing list atoms to (cold) inlets.
The text was updated successfully, but these errors were encountered: