Re: Reader flags to indicate different kinds of files Marc Nieper-Wißkirchen 27 May 2020 09:21 UTC

I'd say keep separate things separate. Reader flags should affect how
things are read by `read' procedure (and the Scheme reader) and should
not be (mis)used for anything else. A reader flag for different Scheme
dialects is fine as long as it switches the reader into the
appropriate mode, but the flag itself should not communicate any
meaning of the underlying Scheme data.

This is up to the Scheme data itself. For example, R7RS library
definitions start with a define-library form, R6RS library definitions
with a library form, top-level programs with an import form, etc.

Am Mi., 27. Mai 2020 um 11:14 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:
>
> > file contents should ideally be self-describing. `#!r6rs`
> > and `#! /usr/bin/env fantastic-scheme` are two such useful identifiers.
> > Perhaps the  `meta.scm` file can start with `#!metadata` or something.
> > Would that be considered reader abuse?
> Come to think of it, since Scheme has a separate metalevel for
> `define-library`, how come there isn't a general `#!meta` read flag?
> That would obviate the need for the separate `.sld` filename extension
> as well.
>
> Maybe it's because the separate metalevel is not a required part of
> R7RS, but just one implementation strategy?
>
> In any case, that reader flag could potentially be useful. This corner
> of Scheme is a bit murky to me, so it's possible I'm missing an obvious
> reason why it's a bad idea.
>
> If there's a `meta.scm` or `scheme.scm` library lookup metadata file,
> perhaps that file should have yet another reader flag.
>
> There could be a general `#!data` flag for files that are not Scheme
> program or library definitions.