bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#74385: [PATCH 3/4] srfi-64: Export define-equality-test.


From: Ludovic Courtès
Subject: bug#74385: [PATCH 3/4] srfi-64: Export define-equality-test.
Date: Mon, 09 Dec 2024 18:01:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Tomas,

Tomas Volf <~@wolfsden.cz> skribis:

> +(define-syntax define-equality-test
>    (syntax-rules ()
>      ((_ name test-proc)
>       (define-syntax name
>         (λ (x)
>           (syntax-case x ()
>             ((_ test-name expected test-expr)
> -            #`(%%test-2 #,x test-proc test-name expected test-expr))
> +            #`(%test-2 #,x test-proc test-name expected test-expr))
>             ((_ expected test-expr)
> -            #`(%%test-2 #,x test-proc #f        expected test-expr))))))))
> +            #`(%test-2 #,x test-proc #f        expected test-expr))))))))
> +(set-documentation! 'define-equality-test
> +  "@defspec define-equality-test identifier proc
> +Define a new test form named @var{identifier} with same signature and usage 
> as
> +@code{test-eq} but using @var{proc} instead of @code{eq?}.

I didn’t notice earlier, but you can add docstrings like this:

  (define-syntax define-equality-test
    (syntax-rules ()
      "This is the docstring."
      …))

As for exporting ‘define-equality-test’, I would clearly mark it as a
“GNU extension”.

The way this was done before is by having more exports in a separate
module, like (srfi srfi-9 gnu).

Whether or not you pick this approach, please make sure to document it
in the manual and to prominently mark it as a GNU extension.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]