In message <> you wrote:
> Barton C Massey wrote:
> > It's a less-than-good feature of C.  Case labels are labels,
> > and thus must label a statement.  
> For what it's worth, in object-oriented land (I mainly do Java these 
> days) case statements are also (supposed to be) atomic operations.  Same 
> idea, slightly different syntax.

I'm not sure what you mean here.  In Java declarations are
statements, as they should be[*], and so you can put them
right after a case label and everything works great.

(Duff's Device is also illegal in Java, which is a bit sad.
Case labels must occur only immediately inside a switch.)


[*] Actually, declarations should be expressions, as they are
    in Nickle (  This allows some
    convenient and clear notation, such as
      scanf("%d %d", &(int x), &(int y));
      printf("%d %d\n", x, y);

psas-avionics mailing list

Reply via email to