http://d.puremagic.com/issues/show_bug.cgi?id=9009
Summary: allow foreach without identifier Product: D Version: unspecified Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: monarchdo...@gmail.com --- Comment #0 from monarchdo...@gmail.com 2012-11-12 07:57:54 PST --- Minor enhancement request, but the language should allow using "foreach" without specifying an iteration name. THis can be useful when you want to iterate a fixed amount, without caring about the index. For example, when you want to "popFrontN exactly" (popFrontN is safe, so slightly slower), you'd want to write: foreach( ; 0 .. n ) r.popFront(); Right now, if you do this, you get: main.d(5): Error: basic type expected, not ; main.d(5): Error: no identifier for declarator int for can do without declarators, I don't see why foreach can't have the above syntax. Just a minor ER, but I think it would make foreach that little extra user friendly. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------