Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c Subject: Re: questions from using lint Message-ID: <2783@utcsri.UUCP> Date: Fri, 16-May-86 22:32:17 EDT Article-I.D.: utcsri.2783 Posted: Fri May 16 22:32:17 1986 Date-Received: Fri, 16-May-86 22:42:33 EDT References: <501@brl-smoke.ARPA> <797@bentley.UUCP> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 35 Summary: > 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