Josh, tracing the story further back:
This is certainly looks like the motivation for trailing closures in Ruby, where the .each method is the preferred iteration idiom. (Ruby has a for loop too, but it’s semi-broken and generally frowned upon.)
I don’t know the history of each in Ruby, but it’s a pretty good bet it traces right back to Smalltalk, which did exactly what Chris describes here:
Smalltalk:
foo < bar
ifTrue: [^'foo smaller']
ifFalse: [^'bar smaller]
Here foo < bar returns a Boolean, and we are send it an ifTrue:ifFalse: message. That sounds tantalizingly like Objective-C (not a coincidence!), but [ ] are block delimiters, not method invocation delimiters. Smalltalk doesn’t specially delimit method invocations at all:
self.listPane().parent().color(Color.black()) // Swift-like
self listPane parent color: Color black // Smalltalk (no parens needed!)
You only need parens if you need to override the default binding precedence of method invocations. When you use parens, you group them around the whole method invocation (receiver included) because they are just normal expr-delimiting parens and not some special method invocation syntax:
stuff includes: foo ifTrue: [...] // → stuff.includes(foo, ifTrue: { … })
(stuff includes: foo) ifTrue: [...] // → stuff.includes(foo).ifTrue({ … })
This means that in Smalltalk, which pioneered this kind of control flow by message passing, there is no special distinction necessary for trailing closures; the last argument just runs on past the end of the invocation with no intervening delimiter that needs balancing.
Ruby was directly and heavily influenced by Smalltalk, but decided to use the more familiar receiver.method(args) syntax. I don’t know whether it was the very first language to introduce a special syntax for trailing closures[1], but it’s the earliest I’m aware of.
[1] In Ruby they’re blocks, which are related but not equivalent to closures. Same spirit though; the history clearly runs through them.