[Top][All Lists]

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

Re: G-expressions in native-search-paths

From: Reza Housseini
Subject: Re: G-expressions in native-search-paths
Date: Tue, 8 Aug 2023 11:50:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

There's two issues here:

One, you can't use a gexp in FILES.  This will work fine:

   (files (list (string-append "share/" name "-" version)))

"name" and "version" come directly from the package definition?
How do I know where to use gexp's and where not?
Two, this:

   '(string-append "share/" name "-" version)

does *not* evaluate to what you think it does; in fact, it becomes this:

   (list 'string-append "share/" 'name "-" 'version)

a list of strings and symbols, because it's quoted.  If you want to use
an expression within a quoted form, you can use quasiquote:

   `(,(string-append …))

LIST works fine most of the time, though.

Thanks I knew about quasiquote, but as mentioned above when do I have to use quasiquote and when do I use gexp's? Using one or the other makes the package description more readable IMO.

And why does it look like that in the error message it was actually able to evaluate #$name to a string (cfdemcoupling; the package name) but still fails with an error...?

Thanks again and best regards,

Reza Housseini

This message is signed with my GnuPG key:

    C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52

Attachment: OpenPGP_0xC375C6AF05125C52.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

reply via email to

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