Skip to main content

Map Difference

rascal-0.34.0

Synopsis

The difference between two maps.

Syntax

Exp₁ - Exp₂

Types

Exp₁Exp₂Exp₁ - Exp₂
map[TK₁, TV₁]map[TK₂, TV₂]map[lub(TK₁,TK₂),lub(TK₁,TK₂)]

Description

The result is the difference of the two map values of Exp₁ and Exp₂, i.e. a map with all pairs in Exp₁ that do have a key that does not occur in Exp₂.

Examples

rascal>("apple": 1, "pear": 2) - ("banana": 3, "apple": 4);
map[str, int]: ("pear":2)