[swift-evolution] for-else syntax

Jeremy Pereira jeremy.j.pereira at googlemail.com
Mon Feb 6 04:50:49 CST 2017


> On 3 Feb 2017, at 18:00, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> on Fri Feb 03 2017, Dimitri Racordon <swift-evolution at swift.org> wrote:
> 
>> Talking of Python, Swift is not Python and the argument not to
>> implement a feature because its semantics conflict with the semantics
>> of a similar looking feature in another language is bogus. 
> 
> I don't have a anything to say about for-else, but just a comment on the
> meta-point of how we evaluate designs: precedent set by other languages
> affects learnability, and is one of the criteria we've always considered
> when designing Swift.
> 

Two things:

1. Somehow the quoting in your email has got messed up so it looks like a statement I made was made by somebody else who may or may not agree with the sentiment expressed.

2. You’ve never been shy of going against precedent if you consider it to be a *bad* precedent. Otherwise Swift would still have C style for loops and pre/post increment/decrement operators. That is as it should be. The Python for … else statement is a mess. My brief survey of the Internet suggests it is confusing even to some Python programmers. It should not be allowed to prevent the Swift team from implementing similarly named but better designed features if there are other good reasons for doing so.


> HTH,
> 
> -- 
> -Dave
> 
> _______________________________________________
> 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