Navigation
Synopsis Test whether the value of an expression is defined.
Syntax Exp ?
Types
Exp Exp ?
T bool
Description If no exception is generated during the evaluation of Exp, the result is true. Otherwise, it is false.
Examples
rascal>T = ("a" : 1, "b" : 2);
map[str, int]: ("a":1,"b":2)
rascal>T["b"]?
bool: true
rascal>T["c"]?
bool: false
rascal>L = [10, 20, 30];
list[int]: [10,20,30]
rascal>L[1]?
bool: true
rascal>L[5]?
bool: false
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.