Documentation strings, declarations, markup, metadata Lassi Kortela (25 May 2024 10:32 UTC)
Re: Documentation strings, declarations, markup, metadata Lassi Kortela (25 May 2024 10:53 UTC)
Re: Documentation strings, declarations, markup, metadata Antero Mejr (25 May 2024 11:07 UTC)
Re: Documentation strings, declarations, markup, metadata Lassi Kortela (27 May 2024 17:02 UTC)
Re: Documentation strings, declarations, markup, metadata Jens Axel Søgaard (27 May 2024 17:22 UTC)
Bodies in COND, CASE, WHEN, UNLESS, and DO Sergei Egorov (04 Jun 2024 20:30 UTC)
Re: Bodies in COND, CASE, WHEN, UNLESS, and DO Jakub T. Jankiewicz (05 Jun 2024 18:50 UTC)
Re: Bodies in COND, CASE, WHEN, UNLESS, and DO Arthur A. Gleckler (19 Jun 2024 17:54 UTC)
Re: Bodies in COND, CASE, WHEN, UNLESS, and DO Jakub T. Jankiewicz (19 Jun 2024 20:10 UTC)
Re: Bodies in COND, CASE, WHEN, UNLESS, and DO Jakub T. Jankiewicz (19 Jun 2024 20:21 UTC)
Re: Documentation strings, declarations, markup, metadata Lassi Kortela (27 May 2024 20:32 UTC)
Re: Documentation strings, declarations, markup, metadata Jakub T. Jankiewicz (27 May 2024 21:41 UTC)
Re: Documentation strings, declarations, markup, metadata Jakub T. Jankiewicz (25 May 2024 11:51 UTC)
Re: Documentation strings, declarations, markup, metadata Jakub T. Jankiewicz (25 May 2024 12:02 UTC)
Re: Documentation strings, declarations, markup, metadata Lassi Kortela (27 May 2024 17:21 UTC)

Re: Documentation strings, declarations, markup, metadata Jakub T. Jankiewicz 27 May 2024 21:41 UTC

My previous email was rejected by SPAM Assassin.

On Mon, 27 May 2024 19:22:29 +0200
Jens Axel Søgaard <xxxxxx@soegaard.net> wrote:

>
> Not introducing new syntax has the added benefit that a documented
> program can run unaltered on an Scheme implementation
> that hasn't implemented the proposal yet.
>
> The usual approach is something like this:
>
>     (define (foo a b)
>         <some string literal documenting `foo`> ...
>         <actual body of `foo`>)
>
> The documentation system can then use the string literals to generate
> documentation in some format.
>
> For the record, since s-expressions can express anything, I don't think a
> new syntax is needed.

In LIPS I successfully use this approach and I have standard Scheme syntax
for the code. I don't need to introduce any new syntax.

I used those strings to generate the reference manual on LIPS website.

I think that the more important part of the SRFI should be a way to get the
docstrings back, so you can create tools that extract documentation.

Another thing that is missing is returning all names from environment.

In LIPS I exposed environment objects that could be introspected, but env
function that return list of symbols (that is another way to get the names in
LIPS) is also enough.

If this SRFI should help create documentation those two procedures could be
added (or something similar) (help and env)

(map (lambda (name)
       (list (cons 'name name)
             (cons 'doc (help name))))
     (env))

NOTE: this code doesn't work in LIPS, because of the way `help` is constructed
to be working in the REPL.

Writing documentation inside Scheme that support this would be much easier
then writing a tool that will parse scheme code (at least this is my
preferred way). It would also allow to create REPL for the implementation that
supports built documentation.

Better introspection (reflection) is one thing that I really miss in Scheme.

--
Jakub T. Jankiewicz, Senior Front-End Developer
https://jcubic.pl/me
https://lips.js.org
https://koduj.org