GNU bug report logs -
#51838
[PATCH 00/11] guix: node-build-system: Support compiling add-ons with node-gyp.
Previous Next
Reported by: Philip McGrath <philip <at> philipmcgrath.com>
Date: Sun, 14 Nov 2021 12:43:01 UTC
Severity: normal
Tags: patch
Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi,
Am Freitag, dem 07.01.2022 um 16:07 -0500 schrieb Philip McGrath:
> My base position is that regexps should not be mandatory or default.
> It was very convenient to be able to just copy--paste package names
> from "package.json" into '#:absent-dependencies' (or whatever). I can
> imagine it being useful for tooling, too, to be able to find just
> from the package definition the dependencies which are being deleted,
> rather than having to either download the origins or try to
> reconstruct names from regexps.
I don't think tooling should be too big of an issue, since you could
teach your tool to support regexp. I.e. instead of checking whether a
newly added package has the name, you check whether it fits the
pattern. That might generate false positive in some cases, perhaps
even many, but we can (and should) refine regexps that are too generic.
> Alternatively, I would also be ok with [...] a slight variant on it
> in which the user would write:
>
> `("foo" "bar" ,(make-regexp "baz"))
>
> Since this (either variant) would not change the interpretation of
> strings in the list of dependencies to delete, it could also be added
> later without breaking compatibility.
That's true, but the main reason to add it from my perspective is that
we don't need to change how regexps are interpreted from the rest of
Guix to make basic strings match fully. For the fun of it, we could
also extend this to procedures of a single value so that one can
finally supply (const #t) :D
> I also think full string matches are better, regardless of any of the
> above. Here's an implementation that avoids unneeded copies and
> string comparison:
>
> (define (regexp-match-exact? rx str)
> (define m (regexp-exec rx str))
> (and m
> (= (match:start m) 0)
> (= (match:end m) (string-length str))))
I can't say this is more beautiful than
(equal? (and=> (regexp-exec rx str) match:substring) str), but there's
only that many ways of making a partial match a full one and Guile core
has none of them...
This bug report was last modified 3 years and 195 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.