Tag Archives: enums

Updating Aldwych (Part 1): Parsing JSON with recursive enums in Swift


via Updating Aldwych (Part 1): Parsing JSON with recursive enums in Swift.

The purpose of Aldwych from the very beginning has been to provide JSON parsing that is type safe, flexible and familiar. And when recursive enums were first announced by Chris Lattner at WWDC 2015, I hoped they would enable a great internal simplification of the JSON parser.

A persistent tree using indirect enums in Swift


via A persistent tree using indirect enums in Swift | Airspeed Velocity.

Suppose you want an ordered set. Set is great and all, but it’s unordered. You could always use a Setanyway, and sort the contents when needed. Or you could use an array, keep it sorted, and always insert new elements in the right place. Or, you could use a tree.