Last - but not least! - two DConf talks

via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Fri Jul 17 06:00:28 PDT 2015


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) {
>     writeln(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...


More information about the Digitalmars-d-announce mailing list