In-source documentation pre-SRFI draft #2 Antero Mejr (28 May 2024 05:35 UTC)
Re: In-source documentation pre-SRFI draft #2 Wolfgang Corcoran-Mathe (28 May 2024 23:13 UTC)
Re: In-source documentation pre-SRFI draft #2 Antero Mejr (29 May 2024 00:12 UTC)
Re: In-source documentation pre-SRFI draft #2 Arthur A. Gleckler (29 May 2024 01:51 UTC)
Re: In-source documentation pre-SRFI draft #2 Antero Mejr (29 May 2024 02:10 UTC)
Re: In-source documentation pre-SRFI draft #2 Arthur A. Gleckler (29 May 2024 02:16 UTC)
Re: In-source documentation pre-SRFI draft #2 Philip McGrath (29 May 2024 19:19 UTC)
Re: In-source documentation pre-SRFI draft #2 Antero Mejr (29 May 2024 23:37 UTC)
Re: In-source documentation pre-SRFI draft #2 Antero Mejr (29 May 2024 23:41 UTC)
Re: In-source documentation pre-SRFI draft #2 Wolfgang Corcoran-Mathe (30 May 2024 03:02 UTC)

Re: In-source documentation pre-SRFI draft #2 Antero Mejr 29 May 2024 02:09 UTC

"Arthur A. Gleckler" <xxxxxx@speechcode.com> writes:

> On Tue, May 28, 2024 at 5:12 PM Antero Mejr <xxxxxx@antr.me> wrote:
>
>     (read-doc port)
>     => documentation record
>          attached = #f
>          text = "   Note: the answer should be five. "
>          content = #f
>
> Shouldn't content be eof-object? If it's #false, you won't be able to
> distinguish the last case from "#false" appearing in the input stream.

The last documentation comment uses #|? ... ?|#, which means it is
unattached (see the attached = #f field in the record). So the content
field will always be #f, because there is no content. After reading that
unattached record, then the eof-object will be read, because the port is
exhausted.

Attached documentation comments cannot appear at the end, so their
content will not be eof-object either. The spec says:

An exception should be raised [by read-documentation] if an attached
documentation comment is read, but there are no more objects to read
before the expression ends or the port is exhausted.