> On May 8, 2017, at 12:09 AM, Xiaodi Wu <xiaodi...@gmail.com> wrote:
> 
> Highly disagree. Consistency teaches us that variables can come after a colon.

But not normally in a declaration.

> On May 8, 2017, at 12:28 AM, Xiaodi Wu <xiaodi...@gmail.com> wrote:
> 
> Yes, Robert came up with a very clever puzzle. I'll bet you there are 
> *plenty* of neat puzzles that you can come up with if you start naming your 
> variables `Int` and `Double`.

Sure, but how many of them look *so much* like a declaration that, even knowing 
there's a puzzle, you still don't guess what's going on? Because that was my 
experience with his "puzzle".

I know that Swift pattern matching is based on the idea that the pattern looks 
like the code used to construct the value it matches. But in the case of 
capturing values from labeled paren lists, I think it leads to deeply confusing 
code. We already knew about the weirdness of `as` in pattern matches, but this 
is even worse.

I think we ought to reconsider what we're doing in this area, and perhaps move 
more towards a syntax that echoes declaration rather than use. When a piece of 
syntax *really* looks like it does A, even to experienced users, but it 
actually does B, that's a sign that it's the wrong syntax.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to