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: Mon, 3 Jan 2022 21:07:07 -0800 (PST) Organization: Compilers Central Lines: 34 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <22-01-010@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> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="66195"; mail-complaints-to="abuse@iecc.com" Keywords: syntax, comment Posted-Date: 04 Jan 2022 13:15:39 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-007@comp.compilers> Xref: csiph.com comp.compilers:2792 On Monday, January 3, 2022 at 11:58:39 AM UTC-8, mac wrote: > > [Interesting take. In reality, of couse, BASIC borrowed that from Fortran. Algol > > used := for assignment, different from = for equality comparison. -John] > Indeed. > Unfortunately, assignment is probably the single most common operator. > The ASCII committee should have kept the left-arrow character instead of > replacing it with underscore. The assignment statement in BASIC, at least the ones I know, has an (optional) LET keyword, so it might say: 10 LET A=3 Most people leave it off, though. Is PL/I the only language that uses = for both assignment and the relational operator? Since expressions are not statements, it avoids the ambiguity that would otherwise occur. I believe some BASIC also use = for both. Underscore is a pretty useful character. The two ASCII characters that don't exist in EBCDIC are ^ and ~. Two EBCDIC characters that don't exist in ASCII are 𝇍 (cent) and ¬ (logical NOT sign). Conversion tables usually cross map those pairs. (PL/I, at least, uses ¬ and ¬= operators.) [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]