erg 0.6.53

The Erg programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
IntList = Class NoneType or { .node = Int; .next = IntList }
IntList.
    null = IntList None
    insert self, node = IntList { .node; .next = self }
    fst self =
        match self::base:
            { node; next = _ } => node
            None => None

l = IntList.null.insert 1
assert l.fst() == 1