kwh@bentley.UUCP (KW Heuer) (05/22/86)
In article <2783@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
sam@delftcc.UUCP (Sam Kendall) (05/30/86)
kwh@bentley.UUCP writes: > utcsri!greg writes: > >What about the following sort of thing, though ? ( this is > >how I would write it in normal C ): > > /* [example abridged by sam@delftcc.UUCP] */ > > 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] > > ); > > No problem. Remove the braces, leave the indentation alone, and tack a > backslash onto the first three lines of the printf statement. You don't need the backslashes. Indentation should be significant only before a statement, or something like that. So indentation in the middle of an expression, such as in the printf above, is ignored. ---- Sam Kendall { ihnp4 | seismo!cmcl2 }!delftcc!sam Delft Consulting Corp. ARPA: delftcc!sam@NYU.ARPA