[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/7] licenses: Add a list of licenses.
From: |
Alex Kost |
Subject: |
Re: [PATCH 2/7] licenses: Add a list of licenses. |
Date: |
Sun, 24 Jan 2016 01:37:00 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Ludovic Courtès (2016-01-23 20:08 +0300) wrote:
> Alex Kost <address@hidden> skribis:
>
>> * guix/licenses.scm (%licenses): New variable.
>
> For the purposes of this patch set, I think we’d rather avoid that, and
> instead do something like:
>
> (module-map (lambda (sym var)
> (variable-ref var))
> (resolve-interface '(guix licenses)))
>
> WDYT?
Oh, great, I didn't know about 'module-map', thanks! But since there
are also things like 'license?' or 'license-uri' in this module, we need
to ignore objects which are not licenses. Would it be ok to do it like
this:
(hash-fold (lambda (sym var res)
(let ((object (variable-ref var)))
(if (license? object)
(cons object res)
res)))
'()
(module-obarray (resolve-interface '(guix licenses))))
or is there a more idiomatic way?
--
Alex