all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Reza Housseini <reza.housseini@gmail.com>
To: "(" <paren@disroot.org>
Cc: help-guix@gnu.org
Subject: Re: G-expressions in native-search-paths
Date: Tue, 8 Aug 2023 11:50:33 +0200	[thread overview]
Message-ID: <b07c668e-2fd3-f438-f8d4-a197037cc2f7@gmail.com> (raw)
In-Reply-To: <87sf8t27qd.fsf@disroot.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 1243 bytes --]

> 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 #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-08-08  9:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  9:01 G-expressions in native-search-paths Reza Housseini
2023-08-08  9:36 ` (
2023-08-08  9:50   ` Reza Housseini [this message]
2023-08-08 10:39     ` (

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b07c668e-2fd3-f438-f8d4-a197037cc2f7@gmail.com \
    --to=reza.housseini@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=paren@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.