[swift-evolution] SE-0030 Property behaviours

Radosław Pietruszewski radexpl at gmail.com
Thu Feb 25 10:57:28 CST 2016


I’m not sure this is a great grammar simplification since we still need the { get { }; set { } } syntax…

And computed properties seem like quite a basic, almost fundamental feature (unlike lazy, @NSCopying etc).

> This is closely related to discussion of removal of `if let x = ...` in favor of `if let x? = ...`
> Intentions are the same: remove extra entities and simplify grammar.

A discussion which, AFAIR, was quickly put to rest, since the Swift team tried it and people didn’t like the change.

— Radek

> On 25 Feb 2016, at 14:14, Антон Жилин via swift-evolution <swift-evolution at swift.org> wrote:
> 
> An idea for future directions (quite obvious, but not yet discussed).
> Extract current computed properties into a library behaviour, that is, convert
> 
> var x: Int {
>    get { ... }
>    set { ... }
> }
> 
> To
> 
> @computed var x: Int {
>    get { ... }
>    set { ... }
> }
> 
> This is closely related to discussion of removal of `if let x = ...` in favor of `if let x? = ...`
> Intentions are the same: remove extra entities and simplify grammar.
> 
> What do we do with read-only computed properties? Defaulting set accessor to fatalError() is not really a solution.
> 
> P.S. The initial email was blocked by Mailman, don't respond to it, please.
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160225/95191e77/attachment.html>


More information about the swift-evolution mailing list