Skip to main content

Boolean NoMatch

rascal-0.34.0

Synopsis

Negated [Boolean Match] operator.

Syntax

Pat !:= Exp

Types

//

PatExpPat !:= Exp
[Patterns]valuebool

Description

See Patterns for a complete description of the possible patterns on the left-hand side. The expression will return true if the pattern can not match in any way. It will use back-tracking in case the pattern is non-unitary to find a possible match, but it will not backtrack again after it has not found a match unless a larger context mandates it.

Examples

rascal>123 !:= 456;
bool: true
rascal>[10, *n, 50] !:= [10, 20, 30, 40];
bool: true
rascal>{10, *n, 50} !:= {40, 30, 30, 10};
bool: true