write-bytevector, write & co. Lassi Kortela (16 Aug 2020 10:24 UTC)
Re: write-bytevector, write & co. Marc Nieper-Wißkirchen (16 Aug 2020 10:33 UTC)
Re: write-bytevector, write & co. Daphne Preston-Kendal (16 Aug 2020 10:37 UTC)
Re: write-bytevector, write & co. Marc Nieper-Wißkirchen (16 Aug 2020 10:44 UTC)
Configuring read and write for syntax extensions Lassi Kortela (16 Aug 2020 11:04 UTC)
Re: Configuring read and write for syntax extensions Shiro Kawai (16 Aug 2020 11:46 UTC)
Re: Configuring read and write for syntax extensions Lassi Kortela (16 Aug 2020 11:55 UTC)
Re: Configuring read and write for syntax extensions Marc Nieper-Wißkirchen (16 Aug 2020 11:59 UTC)
Re: Configuring read and write for syntax extensions Lassi Kortela (16 Aug 2020 12:06 UTC)
Re: Configuring read and write for syntax extensions Marc Nieper-Wißkirchen (16 Aug 2020 12:25 UTC)
User-defined writers and recursive write Lassi Kortela (16 Aug 2020 12:38 UTC)
(missing)
(missing)
Re: User-defined writers and recursive write Marc Nieper-Wißkirchen (16 Aug 2020 13:32 UTC)
Re: Configuring read and write for syntax extensions Lassi Kortela (16 Aug 2020 12:26 UTC)
Re: Configuring read and write for syntax extensions Marc Nieper-Wißkirchen (16 Aug 2020 12:33 UTC)
Re: Configuring read and write for syntax extensions Lassi Kortela (16 Aug 2020 12:50 UTC)
Re: Configuring read and write for syntax extensions Shiro Kawai (16 Aug 2020 12:32 UTC)
Re: Configuring read and write for syntax extensions Marc Nieper-Wißkirchen (16 Aug 2020 12:35 UTC)
Re: Configuring read and write for syntax extensions Lassi Kortela (16 Aug 2020 12:44 UTC)
Re: Configuring read and write for syntax extensions Shiro Kawai (16 Aug 2020 12:53 UTC)
Re: Configuring read and write for syntax extensions John Cowan (17 Aug 2020 16:58 UTC)

Re: Configuring read and write for syntax extensions Lassi Kortela 16 Aug 2020 12:06 UTC

> I think it is actually "the right thing" to associate write controls
> with a port (so scrap my earlier suggestion to use parameter). Indeed,
> we already have this for "read". The case-folding is associated with a
> port, not with a particular invocation of "read". This is a good thing
> because it allows signaling controls to the reader through reader
> directives.

Excellent point. That seals the deal for me as well.

And if an output port knows its settings, we can have a
`write-port-settings` (better name welcome) procedure that writes the
corresponding #! directives to the output port. Then you can easily
write files that self-describe what syntax they are using.

> For write, it could look like:
>
> (set-port-flag! port 'srfi-207)
> (write #u8(...))
>
> Here, the invocation of "write" would write something like
> "#!srfi-207" to the port (if it is not already in that mode) and then
> write the bytevector in the specified format.

LGTM!

We should probably use a more specific name like `set-syntax-flag!`.
Port flags could be something that also apply to byte ports, e.g.
blocking vs non-blocking.