What should be added to C

Kent Black kab at reed.UUCP
Wed May 28 13:55:11 AEST 1986


In article <1497 at mmintl.UUCP> franka at mmintl.UUCP (Frank Adams) writes:
>>> o An andif clause for if statements.
>
>You would write:
>
>  if (A) {
>    X
>  } andif (B) {
>    Y
>  } else {
>    Z
>  }
>
>This is equivalent to:
>
>   if (!(A)) goto _Z;
>   X
>   if (B) {
>     Y
>   } else {
>_Z:
>     Z
>   }

Which is equivalent to: 

	if (A)	{
	    X;
	    if (B) 	{
	    	Y;
	    }
	} else	{
	    Z;
	}
	
n'est pas?
I find the last easier to read (if not A, skip B altogether, rather than
putting B at the same `level' as its predicate).  Can you provide an
example that is significantly `clearer' (whatever meaningful term you
prefer ;-) with an 'andif' than with nesting in the block? 
 (N.B., this is not just another `but we
  don't really NEED that' argument; I found
  the 'andif' obfuscatory.  Consider:
 
  	if (A)
		X
 	andif (B)
		Y
	andif (C)	/* if A && !B or if A && B ? */
		etc
 )
 
-----------------------------------------
		
>>> o Elimination of the eight-character truncation of internal variable names
>>> done by some compilers.
...
>So let's make it part of the standard, and those of us who like to write
>portable code can start using it.

Well, you don't *really* make code portable by defining it to be so ;-)
(no, responses to my foolishness are not necessary)
>Frank Adams                           ihnp4!philabs!pwa-b!mmintl!franka
>Multimate International    52 Oakland Ave North    E. Hartford, CT 06108

-----------------------------------------

Kent Black		...tektronix!reed!kab



More information about the Comp.lang.c mailing list