One way to look at foreach as not so bad
Bill Baxter
wbaxter at gmail.com
Fri Oct 20 11:20:01 PDT 2006
BCS wrote:
> Bill Baxter wrote:
>
> I'm not to happy about foreach_reverse (more neutral than anything) but
> I do see a major advantage of both foreaches over the form mentioned above:
>
> outer: foreach(Obj c; &obj.each)
> foreach(int i; &c.each)
> {
> break outer;
> continue outer;
> break;
> continue;
> return;
> }
True. But I think I've needed to break out of inner loops like that
maybe 5 times in 20 years of coding. YMMV.
> any of the lines in the inner loop quickly become an ugly hack when the
> user is writing the blocks as delegates.
--bb
More information about the Digitalmars-d-announce
mailing list