Re: Properly phased lexical syntax extension, read-time evaluation, and HashDot Scheme
Jakub T. Jankiewicz 04 Apr 2021 19:15 UTC
On Sun, 4 Apr 2021 13:20:18 -0400
John Cowan <xxxxxx@ccil.org> wrote:
> On Sun, Apr 4, 2021 at 4:52 AM Marc Nieper-Wißkirchen <
> xxxxxx@nieper-wisskirchen.de> wrote:
>
> > #lang can be used to provide a completely separate reader but in most
> > cases, it will be used to provide the default reader with a dynamically
> > extended read-table. See at the end of this page for an example in
> > Racket: < https://docs.racket-lang.org/guide/hash-reader.html>.
> >
>
> Okay, so you mean #reader rather than #lang. The trouble with #reader is
> that it is so flexible that it is not obvious how to lock it out other than
> with a "suppress mode" that parses but returns nothing (CL *read-suppress*
> parameter), which is a messy complication. The example of '(1 #reader
> "five.rkt"234567 8) becoming '(1 "23456" 7 8) is undelimited, and so we
> have to parse the digits but return zero values. If parsing and semantic
> processing are intertwined, this is quite difficult.
I thought from discussion that you don't want to allow #reader or #lang in
arbitrary place. So it works like She bang #! at the beginning of the file. So
in other places it's just symbol, part of the symbol or syntax error.
It seems that Racket throw error in this case (at least in REPL):
(list '#lang)
But I'm not sure if the error is correct, when using:
(list '#lang baz)
it try to load the language, and then complain about unexpected `)`
--
Jakub T. Jankiewicz, Web Developer
https://jcubic.pl/me