I was doing some googling today and stumbled across this interesting syntax for an “in” broadcast where I want to check to see if any element from the first array is present in the second array:
in([1, 2]).([1, 2, 3])
I haven’t really seen this type of broadcasting before.
It returns a bit vector which makes sense but I am having trouble understanding the semantics of how this is working.
Could anyone explain to me in simple terms how this is working?
I see how this works, but this initially confused me since I would naively expect it to correspond to: [ 1 ∈ ([1,2],), 2 ∈ ([1,2],), 3 ∈ ([1,2],)] == [0, 0, 0]
but the broadcast re-interprets the length-1 tuple ([1,2],) into just [1,2].