BRiX
Advanced Computing Environment
Hosted by SourceForge
brix-os project page

Previous: Compound Accessors ----- Up: Contents ----- Next: Casting

Comparators

The default comparator always return `identical for unparameterized types and `no-match for parameterized types. Comparing two different types with the same structure will always return `no-match. For comparison purposes the alias type is the type it inherits.

All parameterized types should define a custom comparator that takes two Type parameters (first and second) and returns an enumeration of `identical, `no-match or `fits (second fits in first). Only one instance of COMPARATOR per type body.

COMPARATOR body
  • body -- single or block expression

interface: (first:Type, second:Type) -> Enum(identical, `no-match, fits)

Previous: Compound Accessors ----- Up: Contents ----- Next: Casting