Re: Reader flags to indicate different kinds of files Marc Nieper-Wißkirchen 29 May 2020 17:03 UTC

Am Fr., 29. Mai 2020 um 18:03 Uhr schrieb Lassi Kortela <xxxxxx@lassi.io>:

> An email subject is just an approximation. At least we make an effort to
> change them every now and then :-)

It was just for the record! :)

> > If you look for a way to attach meta-information to a Scheme file that
> > is not part of the contained data, you may want to reuse Emacs-style
> > comments (think of file-local variables) for this purpose.
>
> I sound like a broken record, but parsing magic comments in S-expression
> files is unfortunate since the whole point of S-expressions is to be a
> generic, extensible encoding for all kinds of information. For things
> meant to be parsed it's better to coin a new top-level form instead.

The magic comment may contain an s-expression as well (which is the
case for Emacs). It's no more different than hiding an s-expression
behind "#;".

> In Scheme we even have S-expression comments #; which can be used as a
> temporary hack to ignore metadata forms as Scheme code. Or a one-line
> macro that expands to a no-op.

We are talking about meta-information here; it should not be
necessarily part of the actual data. Comments are therefore a good
place to put them.