[swift-evolution] [Pitch] Rename Mirror

Anton Zhilin antonyzhilin at gmail.com
Thu Jul 21 18:06:47 CDT 2016

2016-07-22 1:34 GMT+03:00 Dmitri Gribenko <gribozavr at gmail.com>:
> > 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?
> Why can't we add these features to Mirror in future?

Reflection in some other languages works as follows: we have a type (let's
name it 'Reflection'). Each instance of it contains ID of one type and can,
for example, retrieve an array of its static or normal methods.
'Mirror', on the other hand, serves as a container for information about a
single instance. Moreover, types can completely customize contents of their
'Mirror's. This is incompatible with laziness and with how reflection
should work, based on experience from other languages.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160722/a2f0b77a/attachment.html>

More information about the swift-evolution mailing list