[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/6] emacs: Add 'guix-packages-by-location' command.
From: |
Alex Kost |
Subject: |
Re: [PATCH 1/6] emacs: Add 'guix-packages-by-location' command. |
Date: |
Mon, 18 Apr 2016 10:18:04 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Ludovic Courtès (2016-04-17 18:40 +0300) wrote:
> Alex Kost <address@hidden> skribis:
>
>> Ludovic Courtès (2016-04-16 01:23 +0300) wrote:
>
> [...]
>
>>> If you choose to take the ‘define-values’ approach above, I think you
>>> can just list they keys already in the vhash:
>>>
>>> (define-values (package-by-something-file package-something-files)
>>> (let* ((table (delay …))
>>> (files (delay
>>> (delete-duplicates
>>> (vhash-fold (lambda (file _ result)
>>> (cons file result))
>>> '()
>>> (force table))))))
>>> (values …
>>> (lambda () (force files)))))
>>
>> Great, thanks! I'm going to use this variant. Is there a preference
>> for 'delete-duplicates' over this?:
>>
>> (vhash-fold (lambda (file _ result)
>> (if (member file result)
>> result
>> (cons file result)))
>> '()
>> (force table))
>
> Both are O(n²) and have similar readability, so both are fine with me!
Thanks for clarifying, I have pushed this patchset.
--
Alex
- [PATCH 3/6] emacs: Make 'guix-find-location' interactive., (continued)
[PATCH 4/6] doc: emacs: Add "Locations" section., Alex Kost, 2016/04/04
[PATCH 5/6] emacs: Add interface for package locations., Alex Kost, 2016/04/04
[PATCH 6/6] emacs: Add license/location "Packages" buttons to Info buffer., Alex Kost, 2016/04/04