GNU bug report logs -
#39599
[PATCH 0/2] New build system: copy-build-system
Previous Next
Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>
Date: Fri, 14 Feb 2020 12:52:02 UTC
Severity: normal
Tags: patch
Done: Pierre Neidhardt <mail <at> ambrevar.xyz>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:
> --8<---------------cut here---------------start------------->8---
> (define* (make-file-predicate suffixes matches-regexp #:optional (default-value #t))
> (if (or suffixes matches-regexp)
> (let* ((suffixes (or suffixes '()))
> (regexps (map make-regexp (or matches-regexp '())))
> (predicates (append
> (map (lambda (str)
> (cut string-suffix? str <>))
> suffixes)
> (map (lambda (regexp)
> (cut regexp-exec regexp <>))
> regexps))))
> (lambda (file)
> (any (cut <> file) predicates)))
> (const default-value)))
> --8<---------------cut here---------------end--------------->8---
Good suggestion, thanks!
The logic of this function is a bit convoluted in my opinion, but I
can't think of something simpler and just as short. But since it's a
local function, I guess it's not a big deal.
> Also, as Mathieu wrote, please don’t use SET!.
No problem, but I don't recall seeing this message. Where did Mathieu
write this?
--
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 5 years and 147 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.