Re: [Vala] Small syntax request labeled loops

2008-07-02 Thread Jürg Billeter
On Wed, 2008-07-02 at 10:20 +0300, Arto Karppinen wrote:
  
  Why not do it sh(1) style? (continue 2, break 2).
  
 
 I would say that the perl style is a lot clearer about what happens.
 
 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 agree that the Perl style is clearer, however, I currently don't
intend to add either to Vala, as both will make the code harder to read,
and I don't see sufficient need for this functionality.

If you have complex nested loops you might want to consider using helper
methods, this usually makes the code a lot clearer.

Jürg

___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list


Re: [Vala] Small syntax request labeled loops

2008-07-02 Thread Travis Watkins
2008/6/30 Dov Grobgeld [EMAIL PROTECTED]:
 A small syntax enhancement borrowed from Perl that I would like to see in
 vala is labeled loops, that can be referenced in continue and break
 statements. Here is an example:


 pixels:
 while(foo) {
 for (int i=0; i1000; i++) {
 if (a)
 break pixels;
 if (b)
 continue pixels;
 }
 }

 See the last and next statements of perl for a larger example.


Why not just ask for goto, that seems to be what you really want.

-- 
Travis Watkins
http://www.realistanew.com
___
Vala-list mailing list
Vala-list@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list