Parentheses in Control Flow Statements

Personally I don’t have a big interest in optional parenthesis and that wasn’t (in general) what I was arguing for, instead I was arguing for being able to replace the whole the ( ... ) of the for loop with a tuple specifically.

I think it makes sense for the language to avoid too many special purpose syntax constructs and if they exist keep them fairly similar to another.
But we already have several syntactically different if statements that look similar but are actually distinct if(<boolean>), if(<optional>), if(<errorunion>)

So for(<tuple>) |a, b, c| wouldn’t be so unexpected, I just would find it personally less confusing as for <tuple> because with the former I would expect the capture to be just the elements of the tuple, instead of a multi capture for loop.

2 Likes