Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.compilers > #3430

Re: Lisp syntax, A simpler way to tokenize and parse?

Path csiph.com!weretis.net!feeder6.news.weretis.net!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end
From Lieven Marchand <mal@wyrd.be>
Newsgroups comp.compilers
Subject Re: Lisp syntax, A simpler way to tokenize and parse?
Date Mon, 27 Mar 2023 23:15:02 +0200
Organization Compilers Central
Sender johnl@iecc.com
Approved comp.compilers@iecc.com
Message-ID <23-03-028@comp.compilers> (permalink)
References <23-03-011@comp.compilers> <23-03-019@comp.compilers> <23-03-026@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="9504"; mail-complaints-to="abuse@iecc.com"
Keywords Lisp, syntax
Posted-Date 27 Mar 2023 19:43:17 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:3430

Show key headers only | View raw


Kaz Kylheku <864-117-4973@kylheku.com> writes:

> Not every Lisp dialect has hash-dot read-time evaluation; that's
> a feature of Common Lisp, disabled by setting/binding *read-eval*
> to nil. I don't seem to recall that Scheme has it. I deliberately
> kept it out of TXR Lisp.

You also should wrap a use of read in a with-standard-io-syntax and even
then there can still be surprises in CL. One implementation I used by
default still also had the #, that has disappeared from the CLtL2 era of
the standard.

>> A good rule of thumb for production ready software is to define
>> a grammar for valid input and provide a validating parser.
>
> Sure, if you want to waste your time defining grammars and
> writing validating parsers.
>
> This is no longer done that much outside of the Lisp world.  People use XML,
> JSON, Yaml, ..., whose grammar they definitely didn't design or
> implement, and validate the content/shape of the object that comes out.

The Haskell and the Rust world have partially gone to applicative and
monadic parsing. In such a paradigm it's not that hard to write
grammars.

--
Laat hulle almal sterf.  Ek is tevrede om die wêreld te sien brand en die vallende
konings te spot.  Ek en my aasdier sal loop op die as van die verwoeste aarde.

Back to comp.compilers | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

A simpler way to tokenize and parse? Roger L Costello <costello@mitre.org> - 2023-03-24 14:45 +0000
  Re: Lisp syntax, was A simpler way to tokenize and parse? Spiros Bousbouras <spibou@gmail.com> - 2023-03-25 11:55 +0000
    Re: Lisp syntax, was A simpler way to tokenize and parse? gah4 <gah4@u.washington.edu> - 2023-03-25 14:32 -0700
  Re: Lisp syntax, was A simpler way to tokenize and parse? anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2023-03-25 13:14 +0000
    Re: Lisp syntax, was A simpler way to tokenize and parse? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-03-26 00:46 +0000
  Re: A simpler way to tokenize and parse? Lieven Marchand <mal@wyrd.be> - 2023-03-25 19:58 +0100
    Re: A simpler way to tokenize and parse? Spiros Bousbouras <spibou@gmail.com> - 2023-03-26 14:10 +0000
    Re: A simpler way to tokenize and parse? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-03-26 18:19 +0000
      Re: Lisp syntax, A simpler way to tokenize and parse? Lieven Marchand <mal@wyrd.be> - 2023-03-27 23:15 +0200
  Re: A simpler way to tokenize and parse? Kaz Kylheku <864-117-4973@kylheku.com> - 2023-03-26 01:17 +0000

csiph-web