Subject: [bug#77387] [PATCH 1/2] man-db: Parse man macro arguments better.

From: Ludovic Courtès <[email-masked]>
Date: Tue, 08 Apr 2025 17:11:55 +0200

Hi,

Sergey Trofimov <[email-masked]> skribis:

> Ludovic Courtès <[email-masked]> 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’.