[swift-evolution] Optional "endfor", "endif", etc after closing "}"

Stephen Celis stephen.celis at gmail.com
Sat Dec 12 07:16:43 CST 2015


I’m against such a change. It creates a lot of visual noise and ceremony around the creation of every scope.

It would be possible for a custom linter to enforce “// if” comments, though I’ve never found these kinds of annotations useful—they seem to be added as code grows where refactoring/reorganization would probably be the better route.

Stephen

> On Dec 12, 2015, at 7:54 AM, Andrew Brown via swift-evolution <swift-evolution at swift.org> wrote:
> 
> +1
> 
> Anything that supports developers is worth it.
> Can't say I like the syntax but I'll take whatever is agreed.
> 
> ABR.
> 
>> On 8 Dec 2015, at 14:43, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> 
>>> On Dec 8, 2015, at 8:42 AM, Amir Michail via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> Unlike something like “} // if”, the compiler would actually check "} endif” and report an error if “}” doesn’t close the expected construct.
>> 
>> Or perhaps more elegantly (again, it’s optional): 
>> 
>> if ... {
>>>> if }
>> 
>> for ... {
>>>> for }
>> etc.
>> 
>> 
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>> 
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list