Mathieu Lirzin (2016-01-26 00:41 +0300) wrote:

> "Thompson, David" <dthomps...@worcester.edu> writes:
>
>> Does the fact that so many files needed to be edited indicate the need
>> for a single specification string constructor?  If this had already
>> been the case, then this patch would have only needed to change 1 or 2
>> procedures.
>
> I don't know if such string constructor would help here.  My change log
> is maybe a bit misleading.  Most of the files changed are for
> documentation and tests which require inevitably to be updated manually
> for such interface change.
>
> Some noise is introduced because now the canonical package full name
> (with '@') is not a factor of the store file names anymore (which still
> uses '-').  Maybe there can be some improvements on this side?
>
> Finally, There is some code redundancy for the emacs UI but If I
> remember correctly there is a reason for that. (Alex?)

If there is redundancy in the code, it should be removed.  I didn't find
a procedure to make a name specification at the time, so I wrote
'make-package-specification' in "emacs/guix-main.scm".  I think we can
add a general procedure to construct a name specification to (guix
utils):

(define* (package-name-specification name #:optional version output)
  (let ((full-name (if version
                       (string-append name "@" version)
                       name)))
    (if output
        (string-append full-name ":" output)
        full-name)))

Then 'package-full-name' from (guix packages) and the code from
"emacs/guix-main.scm" can use it.  WDYT?

-- 
Alex

Reply via email to