bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu-maintenance: Improve 'official-gnu-packages'; add the re


From: Nikita Karetnikov
Subject: Re: [PATCH] gnu-maintenance: Improve 'official-gnu-packages'; add the related procedures.
Date: Wed, 27 Mar 2013 00:22:33 +0400

> “Eval is evil”, as lispers love to say.

Yeah, I've heard this one.

> It should never be used, unless there’s a very good reason to do so.

I've heard this too.  But people always fail to explain the "a very good
reason" part.  Any examples?  AFAICT, it just means: "I haven't found a
better solution."

> In my unfinished binary substitute where a similar situation arises,
> I’ve done this:

[...]

> And then, it is used like this:

>          (alist->record properties
>                         (cut %make-cache url <...>)
>                         '("StoreDir" "WantMassQuery"))

So, keys and values are strings here, right?  But I want to store
setters as values.  I can do it without 'eval', but it'll be necessary
to write something like:

(define (field-setter field)
  (list (list "package"
                          (cons (gnu-package-descriptor (inherit (first state))
                                                                                
        (name field))
                                        (cdr state)))
                (list "mundane-name"
                          (cons (gnu-package-descriptor (inherit (first state))
                                                                                
        (mundane-name field))
                                        (cdr state)))
                ...))
                          
It doesn't look right.

Again, the problem is a need to store setters as values without
repeating (cons (gnu-package-descriptor ...)) for every setter.

Am I missing something?

Attachment: pgppfROFnNqJS.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]