"Manu via Digitalmars-d" wrote in message news:[email protected]...

It gets awkward when you nest, using '_' leads to '__',

i,j,k,etc work just fine.  Are you really nesting your loops that deeply?

and
personally, I would expect an 'unreferenced variable' warning for the
unused loop counter. I like warnings hassling me about unused
variables.

This is a good point.

I also object to the inconsistency with for(;;). Recall Scott Myers talk...

Should we also allow "foreach(;)" ? 'for' being so loose is not necessarily something we want to copy.

It's theoretically an optimisation too; capturing front may be a
costly operation that's not required. Ranges maintain their counters
internally, there's no reason to emit code to capture a local copy of
'front' if it's not used. popFront and empty don't imply a byVal copy,
they usually just update range counters.

The compiler's optimizer will do that just fine.

Reply via email to