[Issue 13522] New: Let's use '_' underscore as official ignore value
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Sep 23 05:29:50 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13522
Issue ID: 13522
Summary: Let's use '_' underscore as official ignore value
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: code at dawg.eu
Some examples where explicitly ignoring a value is needed.
foreach (_; 0 .. 10) {}
foo((a, _) => a);
A more advanced implementation might also allow to use _ in assignments not
only as declarator.
TypeTuple!(a, b, _) = tup[];
The compiler should disallow to access declarations named _, after deprecation.
The identifier _ should not be checked for variable shadowing to allow nested
declarations of _.
If possible the compiler should not generate code to assign/initialize such
declarations, unless the operation has a side-effect.
--
More information about the Digitalmars-d-bugs
mailing list