Path: utzoo!attcan!uunet!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!dkuug!freja.diku.dk!skinfaxe.diku.dk!jensting From: jensting@skinfaxe.diku.dk (Jens Tingleff) Newsgroups: comp.lang.c Subject: Re: C preprocessing Message-ID: <1990Sep24.192558.13966@diku.dk> Date: 24 Sep 90 19:25:58 GMT References: <59770@iuvax.cs.indiana.edu> <223@srchtec.UUCP> <5857@quanta.eng.ohio-state.edu> Sender: news@diku.dk (The Netnews System) Organization: Department Of Computer Science, University Of Copenhagen Lines: 61 rob@raksha.eng.ohio-state.edu (Rob Carriere) writes: >In article <223@srchtec.UUCP> johnb@srchtec.UUCP (John T. Baldwin) writes: >>#1 Why does the program have to be processed as a one-dimensional string >> of tokens? >> >>It doesn't. >> >>At least, programs in general do not have to be processed this >>way. Your C programs are, because the language has been defined that way. >>The reason why language designers like to do this is because it makes it >>easier to write the compiler (i.e. the lexer and parser are easier). And, way out of copmp.lang.c, OCCAM. The english language designed specifically for parallel processing has indention as a block delimiter. E.g. (the SEQ means SEQuence) SEQ SEQ -- Some operations in sequence i := 7 etc etc do.some.thing.or.other(arg.1, arg.2) PAR -- Two operations in parallel do.one.thing() do.another() etc. (the dot `.' is a legal part of a name, weird hu ?) The only thing that makes this bearable, is the idea of folding text editors. In a folding text editor, a group of lines can be made to appear as one line (usually a descriptive caption), so the above becomes SEQ SEQ ... Some operations in parallel PAR ... Two oparetions in parallel This makes the thing readable (slightly..). >There is at least one other reason. Many people (especially those who have >been exposed to FORTRAN) consider formatted languages to be A Bad Thing. The >reason being that my idea of legible formatting need not coincide with the >language designer's. Amen to that. In OCCAM for instance you can't use one of my favourite constructions (but then again, why would you if you weren't me ;^) IF .. THEN init_statements; real_work_statements; END; in Modula-2 where I don't need the BEGIN from pascal.. . Back to you C sufferings ;^) Jens Jens Tingleff MSc EE, Institute of Computer Science, Copenhagen University Snail mail: DIKU Universitetsparken 1, DK2100 KBH O "It never runs around here; it just comes crashing down" apologies to Dire Straits