GNU bug report logs -
#42146
[PATCH core-updates 1/?] build: substitute: Don't fail silently.
Previous Next
Full log
Message #59 received at 42146 <at> debbugs.gnu.org (full text, mbox):
Hi Ludo,
On Thu, 19 Oct 2023 at 22:40, Ludovic Courtès <ludo <at> gnu.org> wrote:
>> +;;;
>> +;;; Extend regexp objects with a pattern field.
>> +;;;
>> +(define-record-type <regexp*>
>> + (%make-regexp* pat flag rx)
>> + regexp*?
>> + (pat regexp*-pattern) ;the regexp pattern, a string
>> + (flag regexp*-flag) ;regexp flags
>> + (rx regexp*-rx)) ;the compiled regexp object
>> +
>> +;;; Work around regexp implementation.
>> +;;; This record allows to track the regexp pattern and then display it.
>> +(define* (make-regexp* pat #:optional (flag regexp/extended))
>
> I’m skeptical about the concrete benefits. I would not include it in
> (guix build utils), or at least not in this patch series.
>
> (I tend to be super conservative about (guix build utils) because we
> rarely get a chance to change it.)
If I remember correctly, the record was introduced in #58660 [1].
Basically, if you have,
(make-regexp "^gnu/packages/python(-.+|)\\.scm$")
then you only have access to some #<regexp 7f6315fb3500>. Other said,
you lost the human-readable "^gnu/packages/python(-.+|)\\.scm$" regexp
pattern. The workaround just stores this human-readable regexp pattern.
Later, it is thus possible to display it; for debugging or else.
For the location of such feature, I do not have an opinion. For the
concrete benefits, I have one. :-)
Well, maybe the feature – keep an access to the human-readable regexp
pattern – could be implemented on Guile-side.
Or maybe there is another simpler way that I am not aware of?
Cheers,
simon
1: https://issues.guix.gnu.org/58660
This bug report was last modified 1 year and 233 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.