Path: csiph.com!1.us.feeder.erje.net!3.us.feeder.erje.net!feeder.erje.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Kaz Kylheku <864-117-4973@kylheku.com> Newsgroups: comp.compilers Subject: Re: Lisp syntax, was A simpler way to tokenize and parse? Date: Sun, 26 Mar 2023 00:46:40 -0000 (UTC) Organization: A noiseless patient Spider Sender: johnl@iecc.com Approved: comp.compilers@iecc.com Message-ID: <23-03-021@comp.compilers> References: <23-03-011@comp.compilers> <23-03-018@comp.compilers> Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="32712"; mail-complaints-to="abuse@iecc.com" Keywords: Lisp, syntax Posted-Date: 26 Mar 2023 05:15:06 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:3423 On 2023-03-25, Anton Ertl wrote: >>[[...] The original plan was that Lisp 2 >>would have M expressions that looked more like a normal language but >>it's over 50 years later and they still haven't gotten around to it. >>-John] > > Actually they have. Some HOPL paper (or several of them) discuss > this: There were several attempts at an Algol-like syntax, but Lisp > proprammers found that they preferred programming in S-Expressions > over the Algol-like syntax, whether it's M-Expressions, Dylan syntax, > or several other attempts. The situation is more nuanced. Common Lisp has programmable read tables which let you have any surface syntax, and this is used. It's just not the predominant mode of writing the bulk of the code. For instance, the cl-interpol library provides string syntax with interpolation. There exists an open source module for Common Lisp called named-readtables which provides disciplined registration for managing multiple read-tables. If a developer wants to mix multiple read-table-based syntaxes in the same source, they can clash. Racket is a popular language based on Scheme, which also has programmable syntax. A Racket source file can begin with a #lang directive which indicates which language module is being used; that syntax then applies to the rest of the file. I have the impression that this is farily widely used in the Racket world. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca