Nikita Karetnikov <nik...@karetnikov.org> skribis: >> What about calling that field ‘doc-urls’ (plural) and having it hold a >> list of URLs? > > Done. > > By the way, some fields return "none." Should it be converted to #f?
Hmm, dunno. Let’s leave it for later. ;-) > +(define (find-packages regexp) > + "Find GNU packages which satisfy REGEXP." > + (let ((name-rx (make-regexp regexp))) > + (filter (lambda (package) > + (and=> (false-if-exception > + (regexp-exec name-rx (gnu-package-name package))) > + (const package))) > + (official-gnu-packages)))) This would give the same result: (filter (lambda (p) (false-if-exception (regexp-exec name-rx (gnu-package-name package)))) (official-gnu-packages)) > (define gnu-package? > (memoize > @@ -97,10 +200,10 @@ > network to check in GNU's database." > ;; TODO: Find a way to determine that a package is non-GNU without going > ;; through the network. > - (let ((url (and=> (package-source package) origin-uri))) > + (let ((url (and=> (package-source package) origin-uri)) > + (name (package-name package))) > (or (and (string? url) (string-prefix? "mirror://gnu" url)) > - (and (member (package-name package) (official-gnu-packages)) > - #t)))))) > + (not (null-list? (find-packages (format #f "^~a$" name))))))))) This can be simplified: (or (and (string? url) ...) (and (member name (map gnu-package-name (official-gnu-packages))) #t)) Thus I think you can remove ‘find-packages’, which is a special case anyway. WDYT? If you agree with the changes, you can then push the final version. Thanks! Ludo’.