Indentation and braces

Gregory Smith greg at utcsri.UUCP
Thu Jun 5 23:50:22 AEST 1986


In article <-18363551 at sneaky> gordon at sneaky writes:
		^^^^^ ????
>
>> ...
>> 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):

[ examples deleted ]

Correct me if I'm wrong, but I was under the impression that UN*X tabs
are at columns 1,9,17,25 etc and that this is not recommended, but in
fact *required* to get anywhere (e.g. ls emits tabs ). If your terminal
doesn't have tabs or has "wrong" tabs, the terminal handler has
ways and means of making it work (i.e. expanding tabs to spaces on their
way to the terminal ). So if your terminal has tabs but they are "wrong",
and you do not enable tab-expansion, you will suffer from inconsistency
between the physical appearance of your screen and the system's idea of
its appearance. In the very least, you won't be able to delete tabs
properly.

>Your terminal's tabs ARE set at column (left edge = column 1) 7, 15, 30, 
>and 72, aren't they?  :-)

:-) indeed.
>
>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?
>
The same thing that happens if you move your terminal 2 inches to the
left during compilation. If you have windows which can move left and right,
then obviously the terminal's physical tabs cannot be used as the places where
the cursor stops when you hit <TAB> ( although they may still be used for
cursor positioning ).


-- 
"We demand rigidly defined areas of doubt and uncertainty!" - Vroomfondel
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg



More information about the Comp.lang.c mailing list