GNU bug report logs - #74385
[PATCH 0/4] Patches for SRFI-64

Previous Next

Package: guile;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Sat, 16 Nov 2024 17:41:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Tomas Volf <~@wolfsden.cz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 74385 <at> debbugs.gnu.org, Janneke Nieuwenhuizen <janneke <at> gnu.org>
Subject: bug#74385: [PATCH 3/4] srfi-64: Export define-equality-test.
Date: Fri, 13 Dec 2024 17:16:47 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> 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."
>       …))

Ah, good catch.  Since that works just for syntax-rules and not
syntax-case, I probably did not moved the documentation string around
when switching between them.  Will update.

>
> 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.

I personally think that leaving it in one module is fine, and I agree it
should be documented.  There are other GNU extensions already in the new
SRFI-64, and I plan to document all once #71300 is merged.  I will wait
for v2 until that happens and will include the documentation changes
required.

Have a nice day,
Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.