[swift-evolution] SE-0030 Property Behaviors

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


> 1. Allow behaviours to specify abstract members that need to be implemented (akin to protocols) and get the initial value of lazy from there, e.g.:
> 
>     var lazy x : T {
> 	func load() {
> 		return 33
> 	}
>     }
> 
>   Pros: clean and clear. Cons: verbosity.

The existing proposal's accessor feature does this. (The syntax would just be `load {}`, not `func load() {}`, though.)

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list