Email list hosting service & mailing list manager

Second round of proposals for directives Lassi Kortela (17 Feb 2021 08:34 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (17 Feb 2021 08:53 UTC)
Re: Second round of proposals for directives Lassi Kortela (17 Feb 2021 09:25 UTC)
Re: Second round of proposals for directives Lassi Kortela (17 Feb 2021 09:43 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (17 Feb 2021 09:51 UTC)
Re: Second round of proposals for directives Lassi Kortela (17 Feb 2021 10:11 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (17 Feb 2021 10:31 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (17 Feb 2021 09:44 UTC)
Re: Second round of proposals for directives Lassi Kortela (17 Feb 2021 10:01 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (17 Feb 2021 10:43 UTC)
Re: Second round of proposals for directives John Cowan (18 Feb 2021 02:56 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (18 Feb 2021 10:37 UTC)
Re: Second round of proposals for directives Vladimir Nikishkin (18 Feb 2021 15:42 UTC)
Re: Second round of proposals for directives Marc Nieper-Wißkirchen (18 Feb 2021 15:51 UTC)

Re: Second round of proposals for directives Lassi Kortela 17 Feb 2021 10:11 UTC

> Following the principle of the existing standardized "#!" directives,
> "#!(encoding EUC-JP)" would change the transcoder of the underlying port
> for subsequent reads (*). In particular, there could be more than one
> "#!(encoding XXX)" directive in a source. Are there any editors that can
> handle multiple "#! Encoding: XXX" in a file?
>
> (*) That said, I don't think that changing the encoding makes sense on
> the level of the reader.  The encoding belongs semantically to the
> underlying port.  Directives should only change how subsequent
> (decoded!) characters are interpreted as tokens.

You're most probably right that changing the encoding mid-file (or
mid-REPL) is a bad idea, though in principle it could be done.

However, it would fit naturally into the reader directive framework.
Does it cause harm if the Scheme reader changes things about the
underlying port?

Currently Gauche and Kawa parse "#!" shebang lines and encoding comments
anyway. If we could formally incorporate these parsers into the Scheme
reader via "#!" syntax, that would seem like a win to me.