![]() |
|
Navigation |
Synopsis Literal in abstract pattern.
Description A literal of one of the basic types Boolean, Integer, Real, Number, String, Location, or DateTime
can be used as abstract pattern.
A literal pattern matches with a value that is identical to the literal.
Examples A literal pattern matches with a value that is equal to it:
rascal>123 := 123 bool: true rascal>"abc" := "abc" bool: trueA literal pattern does not match with a value that is not equal to it: rascal>123 := 456 bool: false rascal>"abc" := "def" bool: falseA literal pattern should be of the same type as the subject it is matched with: rascal>123 := "abc";
|stdin:///|(7,5,<1,7>,<1,12>): Expected int, but got str
![]() |