Restructuring Swift Condition Clauses
SE-0099 (via Erica Sadun):
Swift condition clauses appear in
guard,if, andwhilestatements. This proposal re-architects the condition grammar to enable an arbitrary mix of Boolean expressions,letconditions (which test and unwrap optionals), generalcaseclauses for arbitrary pattern matching, and availability tests. It removeswhereclauses from optional binding conditions and case conditions, and eliminates gramatical ambiguity by using commas for separation between clauses instead of using them both to separate clauses and terms within each clause. These modifications streamline Swift’s syntax and alleviate the situation where many Swift developers don’t know they can use arbitrary Boolean conditions after a value binding.
Bravo.