Am Fr., 2. Apr. 2021 um 03:02 Uhr schrieb John Cowan <xxxxxx@ccil.org>:


On Thu, Apr 1, 2021 at 3:58 AM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
 
Instead, I see the following two ways to proceed:

(1) Reader extensions are provided through normal Scheme libraries. These can be imported at the beginning of source files through a special syntax to define the reader that is used for the rest. This is the approach Racket uses (where "#lang" is its special syntax).

If you remember, we have two use cases: an entirely separate syntax (for which #lang is appropriate) and incremental extensions to existing syntaxes.  The #. proposal is meant for the second case only.

My thesis is that we never want incremental extensions to existing syntaxes (unless we are submitting a contribution to an obfuscated code contest). We want global and maybe local extensions (where a global extension can be seen as a local one encompassing the whole source file).
 
1 2 #.(my-reader "3 4 5") 6 7

This makes editor syntax coloring, paren matching, etc. impossible, since everything would look like a string.

While the lexical syntax I chose was just for demonstration, it doesn't prevent syntax coloring because the editor can detect the string "#.(my-reader " in the input. Actually, it has to understand it because it has to know which formatting rules apply to "3 4 5".