Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!caip!princeton!allegra!ulysses!mhuxr!mhuxn!ihnp4!inuxc!pur-ee!uiucdcs!convex!sneaky!gordon From: gordon@sneaky Newsgroups: net.lang.c Subject: Re: Indentation and braces Message-ID: <-18363551@sneaky> Date: Fri, 30-May-86 23:15:00 EDT Article-I.D.: sneaky.-18363551 Posted: Fri May 30 23:15:00 1986 Date-Received: Wed, 4-Jun-86 19:32:23 EDT References: <855@bentley.UUCP> Lines: 48 Nf-ID: #R:bentley.UUCP:855:sneaky:-18363551:000:1629 Nf-From: sneaky!gordon May 30 22:15:00 1986 > ... > However, if indentation always reflects your intention, then eliminating the > braces and making indentation significant would prevent this type of bug in > the first place! > > Karl W. Z. Heuer (ihnp4!bentley!kwh), The Walking Lint Does anyone have an ANSI standard for where you're supposed to set your tab stops? Determining "amount of indentation" from the whitespace characters in the source isn't that straightforward. Try ordering these sequences of leading white space (presumed to be preceeded by a newline or the beginning of the file, and followed by a statement) by "amount of indentation", without having to supply information to the compiler about what kind of terminal the source was written for (which isn't usually, of course, the same as the terminal, if any, you are running the compilation from): 9 spaces 2 tabs 15 spaces 16 spaces 17 spaces 1 space, 2 tabs 3 tabs 5 spaces, tab, 1 space, tab 3 spaces, formfeed, 3 spaces, tab, tab 3 spaces, formfeed, 15 spaces formfeed, 15 spaces 2,000 spaces, formfeed, 6 spaces 7 spaces, tab, 7 spaces, tab 2 tabs, 1 space 4 spaces, tab, 4 spaces, tab null string (statement starts in first character of the line) formfeed Is control-K (VT) defined as white space? If so, you get more interesting and confusing combinations. Your terminal's tabs ARE set at column (left edge = column 1) 7, 15, 30, and 72, aren't they? :-) Do tabs expand relative to the edge of the terminal, or the edge of the window the compiler is running in? What happens if the window changes during compilation? Gordon Burditt ...!convex!ctvax!trsvax!sneaky!gordon