DefineExpr
From Erights
Revision as of 05:03, 4 January 2009 by Kevin Reid (Talk | contribs)
DefineExpr is a Kernel-E node which matches a pattern against a specified value.
"def" pattern ("exit" optEjectorExpr)? ":=" rValue
Note that the syntax is identical to DefrecExpr, the nonkernel expression which allows recursive definitions; DefineExpr rejects such uses.
Contents |
Fields
Scope
seq(pattern, optEjectorExpr, rValue)
Evaluation
- If present, optEjectorExpr is evaluated.
- rValue is evaluated.
- pattern is matched against the result of rValue, with the result of optEjectorExpr, or throw if not present, as the ejector.
Static constraints
- rValue may not use nouns bound by pattern. (See DefrecExpr.)
- optEjectorExpr may not use nouns bound by pattern.
- pattern may not use nouns bound by rValue.
- pattern may not use nouns bound by optEjectorExpr.