GNU bug report logs - #77387
[PATCH 0/2] man-db: Better parsing of man macros.

Previous Next

Package: guix-patches;

Reported by: Sergey Trofimov <sarg <at> sarg.org.ru>

Date: Sun, 30 Mar 2025 14:27:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #29 received at 77387 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Sergey Trofimov <sarg <at> sarg.org.ru>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 77387 <at> debbugs.gnu.org,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#77387] [PATCH 1/2] man-db: Parse man macro arguments better.
Date: Tue, 08 Apr 2025 17:11:55 +0200
Hi,

Sergey Trofimov <sarg <at> sarg.org.ru> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>>> +             (in-string? #f))
>>> +    (if (>= pos (string-length input))
>>> +        ;; End of input
>>> +        (unless in-string?
>>> +          (reverse (if (null? current)
>>> +                       tokens
>>> +                       (cons (list->string (reverse current)) tokens))))
>>
>> So this procedure can return *unspecified*, right?  Sounds fishy.
>>
> Why is it fishy? Is it unconventional? Such return value is handled
> correctly by the calling code (`match`).

It’s unconventional; usually, procedures are monomorphic and in this
case, the expectation is that it always returns a list of tokens.

I would either return the empty list in the ‘in-string?’ case or throw
an exception (because that means we failed to parse the thing).

Does that make sense?

Thanks,
Ludo’.




This bug report was last modified 39 days ago.

Previous Next


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