Suggestion: Operator `in` for slices
Ola Fosheim Grøstad
ola.fosheim.grostad at gmail.com
Sun Jan 2 10:48:33 UTC 2022
On Sunday, 2 January 2022 at 02:33:22 UTC, Elronnd wrote:
> A redblacktree is not a sequence, though; its elements are not
> keyed in any way.
Right, "in" is a set operator. You can implement a set as a dict
with null-values, then you can think of the keys as values. If
you think of the ADT as the set-concept then what is a key and
what is a value is a matter of interpretation. If you think of a
binary tree (or rbtree) as a set, then the distinction between
key and value becomes blurred.
More information about the Digitalmars-d
mailing list