PreviousUpNext

5.7.16  Mythryl Generic Syntax

The term “functor” is utterly alien to the programming mainstream, where “generic” is the usual term, so Mythryl replaces the functor keyword with generic package to maximize effectiveness of C-trained intuition.

By convention, Mythryl names generics with identifiers ending in _g, but this convention is not compiler-enforced:

    generic package red_black_map_g (k:  Key):  Map where key == k
        {
            ...
        };

(For complete source to the above example see src/lib/src/red-black-map-g.pkg.)


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext