> “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?
pgpnntqgZK7Np.pgp
Description: PGP signature
