Indentation

Mike Banahan mikeb at inset.UUCP
Wed May 14 03:53:21 AEST 1986


In article <797 at bentley.UUCP> kwh at bentley.UUCP writes:
(I just pull out the bit that interests me)

>In article <501 at brl-smoke.ARPA> rbj at icst-cmr (Root Boy Jim) writes:
>>I have ranted about C using a one statement model for its control
>>statements instead of an explicit end statement.  Compound statements are
>>bounded by braces instead.  Yuk!
>
>Ah yes, there are two major types of language in the structured family;
>f77 with "endif" (some members use "end" for all of "endif", "endwhile",
>etc.) and pascal with "begin" "end" (which C abbreviates to "{" "}").  I
>presume this is what you dislike.  (If it's the spelling that bothers you,
>I'm sure you're aware that you can define "begin" and "end" as macros.)
>
>Yet another convention, not endorsed by any language I know, is to dispense
>with the braces and let the indentation alone tell the compiler how to
>interpret the program.  (I came up with this idea after an argument on the
>"correct" place to put the braces.)

Sorry, you're wrong. Occam uses indentation to show nesting. You *can't*
write an incorrectly indented program, because different indent is a different
program!

(Occam is the parallel language for the Inmos Transputer; it's good fun
but boy do you have to re-think those old ideas about sequential execution.)
-- 
Mike Banahan, Technical Director, The Instruction Set Ltd.
mcvax!ukc!inset!mikeb



More information about the Comp.lang.c mailing list