Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: gah4 Newsgroups: comp.compilers Subject: Re: for or against equality, was Why are ambiguous grammars usually a bad idea? Date: Tue, 4 Jan 2022 13:26:00 -0800 (PST) Organization: Compilers Central Lines: 36 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-01-014@comp.compilers> References: <21-12-003@comp.compilers> <21-12-017@comp.compilers> <21-12-022@comp.compilers> <21-12-026@comp.compilers> <21-12-033@comp.compilers> <22-01-007@comp.compilers> <22-01-010@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="5305"; mail-complaints-to="abuse@iecc.com" Keywords: syntax, history, comment Posted-Date: 04 Jan 2022 17:38:05 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <22-01-010@comp.compilers> Xref: csiph.com comp.compilers:2794 On Tuesday, January 4, 2022 at 10:15:42 AM UTC-8, gah4 wrote: (snip, our moderator wrote) > [In original Dartmouth BASIC the LET was mandatory, but it was a considerably > smaller and fully compiled language than the later dialects. On the other > hand, PL/I made a fetish of nothing being a reserved word, e.g. > > IF IF = THEN THEN ELSE = BEGIN; ELSE END = IF; > > -John] I never used any close to the original BASIC, but did use, for some time, the HP TSB2000 version. HP stores programs after tokenizing, so I suspect that even if you don't put in LET, the tokenizer will add it. As for PL/I, it borrowed many features from COBOL, but not the use of reserved words. For one, they wanted people not to have to know the whole language, and not even the words. Stories are that COBOL programmers always keep the list of reserved words nearby, to avoid using them. Counting from a recent IBM web page on their COBOL compiler, there are over 400 reserved words, many common English words that people might like to use. Somehow out of 50 years of programming, I have managed never to even type in and run a COBOL program, and especially not to write one. As for Fortran parsing, I do remember that WATFIV reserves the sequence 'FORMAT(' at the beginning of a statement for actual FORMAT statements. You can't assign to elements of an array named FORMAT. That might not be so bad, except that Fortran 66, in its run-time format feature, requires the format data to be in an array. And the obvious name is FORMAT! [COBOL doesn't have that many reserved words. See https://www.ibm.com/docs/en/i/7.1?topic=list-reserved-words Re FORMAT statements, WATFOR/FIV punted for some reason. It's not that hard to tell a format statement from a statement like FORMAT(I5,A4) = 42 but I realize no sane programmer would do that. -John]