match multimethod

Methods

match(a:Any, b:Any) Source: stdlib.ngs:6469
Used by match EXPR { ... } construct to check whether the expression matches the case. %AUTO match EXPR { ... }

Returns

Pred(b)(a)

Example

r = match x {
  Int  "Got integer"
  /^a/ "Got special string"
  Str  "Got regular string"
}