News for hackers. Stuff that matters.
Re:Null References: The Billion Dollar Mistake – Tony Hoare ... by kazagistar on Wednesday June 01, 2016 @12:50PM (#11815976)
First, to some extent, your code is more a demonstration of the weakness of imperative vs declarative code, since, for example, Haskell lets you declare recursive structures directly, since it doesn't enforce an order of execution where none is needed.

    data Tree = Leaf Tree | Node Tree Tree
    a = Leaf c
    b = Leaf c
    c = Node a b
But more importantly, there is no reason you can't do this with Optionals.

    Tree *a = new Leaf();
    Tree *b = new Leaf();
    Tree *c = new Node(a, b);
    a.parent = b.parent = new Some(c);

There are no comments on this comment yet.