questions from using lint

Gregory Smith greg at utcsri.UUCP
Sat May 17 12:32:17 AEST 1986


> 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.)

COBOL has something which is very similar from a compiler-writer's
point of view - hierarchal data structures are described by giving each
member a 'level number' - map 'level numbers' onto indentation columns,
and both systems are the same.

To describe an 'indentation structured' language as a grammar, you
could introduce the terminals 'indent_more' and 'indent_less' which
could be generated by a lexical analyzer, and would effectively replace
{ and }.

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 );

>:-)

-- 
"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