in (containment) operator
The non-associating, binary infix in operator is used to test whether its left-hand
operand is contained in its right-hand operand.
Usage
void m(Object x, Category y) {
Boolean contained = x in y;
}
Description
Definition
The in operator is defined as follows:
let (x=lhs) rhs.contains(x)
Where the rhs has type Category. Since Ceylon 1.2.2 rhs with
type java.util::Collection is also supported.
See the language specification for more details.
Polymorphism
The in operator is polymorphic.
The meaning of in depends on the
Category interface.
Type
The result type of the in operator is Boolean.
See also
- API documentation for
Category inin the language specification- operator precedence in the language specification
- Operator polymorphism in the Tour of Ceylon