Rename Mirror to DebugRepresentation and CustomReflectable to
Name of Mirror does not reflect (no pun) what it is intended to do, i.e.
providing full featured reflection, which we want to see in Swift 4. Other
than that, it is only intended to serve for debugging purposes, e.g.
building trees for selected objects. Some evidence to that:
- Mirror.DisplayStyle contains optional and set as special cases, but
does not contain function
- Mirror collects all information possible at initialization, while for
true reflection we want laziness
- Mirror allows customization. For example, Array<T> is represented with
a field for each of its elements. Do we want this for “true” reflection we
want to add in the future?
- Rename struct Mirror to DebugRepresentation
- Rename protocol CustomReflectable to CustomDebugRepresentable
- Rename property customMirror to customDebugRepresentation
- Hope that one day we will get a real Mirror with full reflection
Impact on existing code
This is a breaking change; easy automated migration possible.