Ed Schouten wrote:
* Arto Karppinen <[EMAIL PROTECTED]> wrote:
If you have a lot of loops inside one another, it needs some figuring
out which loops happens to be number 2 at any given point.
I bet the compiler already stores references to the current, but also
the parent scope.
I was thinking this from the programmers point of view. A piece of code
which breaks second loop, is not as easy to read, than say a code that
breaks loop pixels.
The problem with numeric break, is that the number of loops is counted
from outside to the inside: Heres an example.
/* Loop alpha */
for (i = 1; i < 10; $i++) {
/* Loop beta */
for (i = 1; i < 10; $i++) {
/* Loop charlie */
for (i = 1; i < 10; $i++) {
/* Loop delta*/
for (i = 1; i < 10; $i++) {
/* This breaks charlie. */
break 2;
}
/* This breaks beta */
break 2;
}
/* This breaks alpha */
break 2;
}
/* This should cause an error. */
break 2;
}
So break 2 means different things depending on where it is. Which is
confusing. So the perl syntax is more expressive, and easier to read.
--
Arto Karppinen
------------------------------
[EMAIL PROTECTED]
_______________________________________________
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list