|
Following the overview is an optional constants section. Each constant takes the form:
name := expression;
The name is a valid variable name; the expression is a literal or any expression that depends only on other constants previously declared within the pattern. Named constants are available in the subsequent trigger, body and removal sections. Constant values are not available outside the pattern they are declared within. Constants should be used for values that are likely to be changed by pattern authors, such as regular expressions to extract versions from paths, and so on. They should not be used for values that are expected to be changed by normal users of the pattern – in those situations, a Pattern Configuration block should be used. For example, this defines two regular expressions to be used in the pattern body: constants cmd_expr := regex "Xvnc"; display_expr := regex "\b:\(\[0-9\]+)\b"; end constants; |
