https://issues.dlang.org/show_bug.cgi?id=9817

Steven Schveighoffer <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |WONTFIX

--- Comment #2 from Steven Schveighoffer <[email protected]> ---
This is a feature of foreach on ranges, not arrays. Arrays are arrays first,
and ranges second.

It's the reason foreach(c; "string") doesn't iterate dchars by default, and the
reason foreach(dchar d; "string") works, but foreach(dchar d; someCharRange)
does not.

I think you are talking about two different things here. While I agree that
foreach being able to use tuples to unpack in the syntax you propose would be
nice, I don't think it hurts to omit the parentheses.

Unpacking tuples syntax can exist alongside the existing mechanism. In any
case, the mechanism is too far ingrained into the language to be simply
deprecated. We can revisit at a later date if/when tuple unpacking becomes
possible.

--

Reply via email to