Right now, if you look at the grammar, it's pretty hard to follow and special cased. I think if people follow an intentional pattern of a condition per line (including where clauses) they won't get in trouble. (Also Swift is a lot smarter about inadvertent = vs ==)
-- E > On May 24, 2016, at 11:59 AM, Austin Zheng <[email protected]> wrote: > > I like the idea in principle. > > However, right now you can write something like: > > if let a = optionalA, frob = fooBarBaz() { ... } > > It's clear that both clauses are optional binding clauses. > > With this change, it's not clear anymore whether the second clause is an > optional binding clause, or a logic test erroneously using '=' instead of > '=='. > > To be fair, though, since assignment in Swift doesn't return the new value as > it does in C, there is far less room for disastrous bugs caused by this sort > of mistake. > > Austin > _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
