On Friday, 17 July 2015 at 11:28:45 UTC, Jacob Carlborg wrote:
I would say that it should first try to interpret "element" as an argument to "each", if that doesn't work, try as a parameter for the delegate. Just going with the longest match, if that doesn't work try the next thing.

That could only happen after semantic analysis, but the ambiguity needs to be resolved during parsing.

This feature has come up before, one of the suggestions back then was to do allow this syntax:

someRange.each(start; element) {

Everything after the semicolon would be interperted as parameters for the delegate.

That could work. But it would require an ugly `.each(; element)` if `each` should be called without arguments...

Reply via email to