2016-08-04 21:31 GMT+03:00 Dave Abrahams <[email protected]>: > > on Thu Aug 04 2016, Anton Zhilin <antonyzhilin-AT-gmail.com> wrote: > > Two weeks ago Adrian and I suggested adding dynamic 'size', 'stride', > > 'alignment' to Mirror, which definition would look like: > > > > public struct ReflectionWrapper { // fixed! > > internal metatype_: Any.Type > > > > public init<T>(_: T.Type) > > > > public var size: Int { get } > > public var stride: Int { get } > > public var align: Int { get } > > > > // ... > > } > > > > There are some problems with it right now, but I do believe that > reflection > > API is where dynamic `size`, `stride`, `alignment` belong. > > I see your point, but that would unfortunately be an unacceptably > expensive way to get that information. Constructing a mirror is a > nontrivial bit of work.
I don't mean current heavyweight Mirror. Call that type ReflectionWrapper, if you want. It would only contain 'Any.Type' stored property. Largest of 'problems' that I meant is that reflection is postponed, and my type would look odd without full reflection capabilities (only with 'size' and friends).
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
