Adds an arbitrary test to a pattern that must also be satisfied in order to have a successful match. If the left-hand pattern fails, the such-that pattern as a whole fails. If the left hand pattern succeeds, the right hand expression is evaluated to a boolean. If the boolean is true, the such-that pattern as a whole succeeds. If false, the match fails. Any other value results in a thrown exception. Normal left to right execution and scoping both apply. The expression can use variables defined by the pattern, and variables defined by the expression are also available in the succeeding scope -- they are variables defined by the such-that pattern as a whole. x |
||||||||||||||||||||||||
Unless stated otherwise, all text on this page which is either unattributed or by Mark S. Miller is hereby placed in the public domain.
|