[swift-evolution] [Review] SE-0122: Use colons for subscript declarations
Dmitri Gribenko
gribozavr at gmail.com
Wed Jul 20 01:12:56 CDT 2016
On Tue, Jul 19, 2016 at 10:50 PM, Chris Lattner via swift-evolution
<swift-evolution at swift.org> wrote:
> Hello Swift community,
>
> The review of "SE-0122: Use colons for subscript declarations " begins now and runs through July 24. The proposal is available here:
>
> https://github.com/apple/swift-evolution/blob/master/proposals/0122-use-colons-for-subscript-type-declarations.md
Weakly against.
The subscript is a crossover between a function and a computed
property, and depending how you look at it, you will find either ":"
to be a better fit if you argue that they are closer to properties, or
that "->" is better, if you argue that subscripts are closer to
functions. I don't find either argument to be more convincing that
the other, so I don't see a reason to change this part of the
language.
I wouldn't mind if the change would be made though, but I think by
changing subscripts to use colons we would end in the opposite, but
totally symmetrical situation compared to what we have now.
Dmitri
--
main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
More information about the swift-evolution
mailing list