Skip to main content

Map in

rascal-0.34.0

Synopsis

Membership test on the keys of a map.

Syntax

Exp₁ in Exp₂

Types

Exp₁Exp₂Exp₁ in Exp₂
T₁ <: TKmap[TK, TV]bool

Description

Yields true if the value of Exp₁ occurs as key in the map value of Exp₂ and false otherwise. The type of Exp₁ should be compatible with the key type TK of Exp₂.

Examples

rascal>"pear" in ("apple": 1, "pear": 2);
bool: true
rascal>"pineapple" in ("apple": 1, "pear": 2);
bool: false