Re: [swift-evolution] Default lazy constructor

2016-01-05 Thread Félix Cloutier via swift-evolution
Have you heard of the property behaviors proposal? Félix > Le 5 janv. 2016 à 08:48:03, James Campbell via swift-evolution > a écrit : > > When creating a lazy variable, maybe we should allow for default closures, i.e > > lazy var userSession: UserSession > > Which will construct that object

[swift-evolution] Default lazy constructor

2016-01-05 Thread James Campbell via swift-evolution
When creating a lazy variable, maybe we should allow for default closures, i.e lazy var userSession: UserSession Which will construct that object for you instead of having to do: lazy var object: MyObject { let userSession = UserSession() return userSession }() If the initial