[swift-evolution] [Review] SE-0030 Property Behaviors

Wallacy wallacyf at gmail.com
Sun Feb 14 17:58:50 CST 2016


>
https://github.com/apple/swift-evolution/blob/master/proposals/0030-property-behavior-decls.md

As for the proposal itself:

>       • What is your evaluation of the proposal?

+1.

However, like Brent says: "this proposal is a good core for property
behaviors, but alone, I don't think it carries its own weight. It will need
at least a couple of the items in "Future Directions" section before it's
really worth having."

In the fact, i prefer the first version of the proposal, the first version
is more "must do", this one is "just nice".

And i'm not convincing of the syntax to, i prefer something like that:
Pipe ( | | ) operator instead `[ ]`, `{ }` or `< >`

var |lazy| a = ...
var |observable| b = ...

and this to access:

a*#*clear() // yes, without the dot.
b*#*addObserver()

"[] delimiters are heavily array/collection/subscript-centric" (Chris)

>       • Is the problem being addressed significant enough to warrant a
change to Swift?

Yes. Sure, i love the entire idea behind this proposal, i think this will
very beneficial for the language.

>       • Does this proposal fit well with the feel and direction of Swift?

Yes.

>       • If you have used other languages or libraries with a similar
feature, how do you feel that this proposal compares to those?

Just some "hacks" in Objective-C.

>       • How much effort did you put into your review? A glance, a quick
reading, or an in-depth study?

I participated in the preliminary discussions re-read all variants of this
proposal a lot of times.


Em dom, 14 de fev de 2016 às 20:35, Haravikk via swift-evolution <
swift-evolution at swift.org> escreveu:

>
> > On 14 Feb 2016, at 11:08, Brent Royal-Gordon via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> >> I ask again:
> >> What is wrong with arrow brackets?
> >>
> >> var<lazy> foo
> >
> >       var<lazy, synchronized> foo: Dictionary<Int, Set<Optional<String>>
> >
> > So, two problems:
> >
> > • Angle brackets already appear in var declarations for generic types;
> that means there are two different meanings for angle brackets in the same
> construct.
> >
> > • When we eventually allow you to apply multiple behaviors to a single
> property, that will also mean that *commas* are used in both of those angle
> bracket constructs, but with different meanings (one means "chain these",
> the other means "fill these two slots").
> >
> > These are not fatal errors, but they're also completely unforced—either
> `[]` or `{}` would not have this problem. So why choose the option that has
> the problem?
>
> Do we need braces and commas at all? It seems to me that you can just do:
>
>         var lazy synchronized foo: Dictionary<Int, Set<Optional<String>>>
>
> The name is always the one right before the colon, so this actually seems
> fine to me. If Xcode can colour them differently then it shouldn’t be hard
> to follow IMO. The order implies the order in which they are resolved where
> relevant, i.e- foo is mutable, then lazy, then synchronised.
> _______________________________________________
> 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/20160214/567c8d18/attachment.html>


More information about the swift-evolution mailing list