drym-org / qi

An embeddable flow-oriented language.
59 stars 12 forks source link

An empty switch with a divert clause passes all inputs #28

Closed countvajhula closed 2 years ago

countvajhula commented 2 years ago

This:

(switch (-5 3) (% 1> 2>) [positive? add1])

... produces

-5, 3

... since none of the conditions match. But it should probably be

3

... instead, since that corresponds to the expectation in the consequent flows for each of the conditions. This expectation is essentially encoded in the divert clause as the "type" or "meaning" of the switch expression.