https://kotlinlang.org logo
#naming
Title
t

thanh

02/14/2023, 12:47 PM
what is the best (or just shorter) name for this
fun Set<A>nonEmptyIntersection(other: Set<A>) = this.intersect(other).nonEmty()
?
l

Leon Linhart

02/14/2023, 12:50 PM
intersects
?
t

thanh

02/14/2023, 12:52 PM
I think looks too similar with
intersect
, but maybe
isIntersected
?
e

ephemient

02/14/2023, 1:34 PM
containsAny
?
t

thanh

02/14/2023, 1:51 PM
containsAny
looks nice, but make me wonder is
hasAny
better?
okay, now I'm really think
sharedAny
should be use. with sharedAny I can do overload like:
set1.sharedAny(set2, set3, set4)
r

Ruckus

02/14/2023, 3:37 PM
I've used
overlaps
for similar things in the past
3 Views