Gen.jl
Gen.jl copied to clipboard
Document disagreement of Base.in and Base.getindex for Selection
For most data structures, in
and getindex
tend to agree, although this invariant does not hold for selections, where in
checks for a full path down the trie, whereas getindex
allows specifying a prefix.
using Gen: select
julia > x = select(:y => 1);
julia > :y in x
false
julia > x[:y]
DynamicSelection(Dict{Any, Selection}(1 => AllSelection()))