Indentation instead of braces
KW Heuer
kwh at bentley.UUCP
Fri May 23 06:26:21 AEST 1986
In article <2783 at utcsri.UUCP> utcsri!greg writes:
>What about the following sort of thing, though ? ( this is
>how I would write it in normal C ):
> ... if( vogsphere == fuddle && !blasted ){
> while( sixteenvalvedualoverheadcam( bleen ) == '?')
> infriddle( batman.utility_belt );
> if( total_confusion_estimated > MAX_CONFUSION )
> printf(
>"Well I think you ought to know that I am getting really confused by %s\n",
> reason_for_confusion[WOMBAT]
> );
> return SAY_WHAT;
> }else post_to_net_lang_c( silly_stuff_like_this );
No problem. Remove the braces, leave the indentation alone, and tack a
backslash onto the first three lines of the printf statement.
Earlier I wondered aloud about the proper interpretation of "if (c) x; y;"
(without newlines). It seems to me that both x and y would be within the
scope of the conditional (ditto for "\tif(c) x;\n\t\ty;\n"). Is this how
it's done in existing languages with significant indentation (OCCAM)? Or
is that syntax illegal, requiring a newline (my guess)?
This feature is not likely to be incorporated into C in the foreseeable
future, So I am directing followups to net.lang only.
Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint
More information about the Comp.lang.c
mailing list