I was trying to do something like this:
x = in.([1,2], [1,3,4])
(BTW, what really want is an array of all the items that are in array 1 AND array 2. Is a broadcasted in
the best way to do that ? )
Wanting a list of indicators of whether the items in the first list are in the second list, so for example
x = [1, 0]
However, what I’ve written does NOT work. However, the documentation is your friend !
https://docs.julialang.org/en/v1/base/collections/#Iterable-Collections
The important note being
wrap
collection
in a tuple or aRef
julia> in.([1,3], Ref([1,2,4]))
2-element BitArray{1}:
1
0
But, what is this Ref
thing ?? I went back to the documentation, but no luck finding it because several pages of matches show up. Interestingly there is a Core.Ref, but I’m pretty sure that’s not the same thing.
What is this Ref
thing as used in my example ?
Thank you.