[Idea] Make lazy an attribute


(Anton Zhilin) #1

One of proposals that will probably be submitted for Swift 4, will be
Property Behaviors propoal.

It aims to generalize @IBOutlet, @synchronized, @delayedinit, and of
course, @lazy.
(Side note: it would be great if it also included unowned)

Because we aim for less breaking changes in Swift 4, we should prepare
ground for it.
The suggestion is to rename `lazy` to `@lazy`.

Besides the aforementioned reason, I think, lazy really has its place among
attributes.
It does not change type of property, it just helps to delay side effects of
initialization.

- Anton


(David Sweeris) #2

Yeah, I was just thinking that we should get the “call-site” syntax settled for property behaviors, for exactly that reason.

···

On May 2, 2016, at 3:39 PM, Антон Жилин via swift-evolution <swift-evolution@swift.org> wrote:

One of proposals that will probably be submitted for Swift 4, will be Property Behaviors propoal.

It aims to generalize @IBOutlet, @synchronized, @delayedinit, and of course, @lazy.
(Side note: it would be great if it also included unowned)

Because we aim for less breaking changes in Swift 4, we should prepare ground for it.
The suggestion is to rename `lazy` to `@lazy`.

Besides the aforementioned reason, I think, lazy really has its place among attributes.
It does not change type of property, it just helps to delay side effects of initialization.

- Anton
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution


(Anton Zhilin) #3

I'm ready to submit a pull request:

https://github.com/Anton3/swift-evolution/blob/lazy-attribute/proposals/NNNN-lazy-attribute.md

- Anton

···

2016-05-03 0:25 GMT+03:00 David Sweeris <davesweeris@mac.com>:

Yeah, I was just thinking that we should get the “call-site” syntax
settled for property behaviors, for exactly that reason.

> On May 2, 2016, at 3:39 PM, Антон Жилин via swift-evolution < > swift-evolution@swift.org> wrote:
>
> One of proposals that will probably be submitted for Swift 4, will be
Property Behaviors propoal.
>
> It aims to generalize @IBOutlet, @synchronized, @delayedinit, and of
course, @lazy.
> (Side note: it would be great if it also included unowned)
>
> Because we aim for less breaking changes in Swift 4, we should prepare
ground for it.
> The suggestion is to rename `lazy` to `@lazy`.
>
> Besides the aforementioned reason, I think, lazy really has its place
among attributes.
> It does not change type of property, it just helps to delay side effects
of initialization.
>
> - Anton
> _______________________________________________
> swift-evolution mailing list
> swift-evolution@swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution