[swift-evolution] SE-0030 Property Behaviors

Brent Royal-Gordon brent at architechies.com
Sun Feb 14 04:58:49 CST 2016


> Ah, yes, sorry, should have double checked with the initial text before sending the message. For some reason I though that the accessor requirement declarations were limited to get/set. But I think that my basic point still holds. E.g. in Joe’s proposal, I don’t really see how lazy behaviour is achieved: the sample implementation for lazy he proposes seems to force evaluation of the initial value at the declaration time. Unless we have some sort of magic that wraps the initial value into a closure (but that is then the same as what Anton suggests, albeit explicitly). 

In Joe's proposal, the initializer expression is wrapped up in a computed property. Because it's a *computed* property, rather than a *stored* property containing a closure, it doesn't take up any extra storage in the instances.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list