From: "(" <paren@disroot.org>
To: Reza Housseini <reza.housseini@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: G-expressions in native-search-paths
Date: Tue, 08 Aug 2023 10:36:13 +0100 [thread overview]
Message-ID: <87sf8t27qd.fsf@disroot.org> (raw)
In-Reply-To: <2c0f0f92-5ca7-a5ed-4059-a98fa60962fe@gmail.com>
Reza Housseini <reza.housseini@gmail.com> writes:
> I am trying to use g-expressions in nativ-search-paths field, but it fails with
> an error message, what is the issue her:
>
> (native-search-paths
> (list (search-path-specification
> (variable "CFDEM_SRC_DIR")
> (files #~'((string-append "share/" #$name "-" #$version))))))
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)))
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.
-- (
next prev parent reply other threads:[~2023-08-08 9:46 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 ` ( [this message]
2023-08-08 9:50 ` Reza Housseini
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=87sf8t27qd.fsf@disroot.org \
--to=paren@disroot.org \
--cc=help-guix@gnu.org \
--cc=reza.housseini@gmail.com \
/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.