DefineExpr

From Erights

Revision as of 05:03, 4 January 2009 by Kevin Reid (Talk | contribs)
Jump to: navigation, search

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

  1. If present, optEjectorExpr is evaluated.
  2. rValue is evaluated.
  3. 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.
Personal tools
more tools