unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice <me@tobias.gr>
To: guix-devel@gnu.org, Feng Shu <tumashu@163.com>
Subject: Re: #:configure-flags flags #~'() or #:configure-flags flags #~()
Date: Thu, 19 Jan 2023 09:27:08 +0000	[thread overview]
Message-ID: <E24751C8-FB89-4F6A-8074-DDA8DEE67ECF@tobias.gr> (raw)
In-Reply-To: <87zgafum69.fsf@163.com>

Hi!

It's not about 'right' (why would grepping Guix return wrong code...? Impossible! :-).  It's a matter partly of preference and partly of using the best tool for the job.

Omitted from your second example is a call to list, and the #~ that both have in common is just syntactic sugar for (gexp ...).

So the two forms you're comparing are:

  (gexp '("a" "b" "c"))
  (gexp (list "a" "b" "c"))

Both are completely equivalent when they contain only strings.  Choose whichever you like.

When you have several procedures to call, calling 'list' can look cleaner:

  (list (string-append "foo=" bar) "baz")

Although strictly speaking ` uses fewer characters and is just as correct:

  `(,(string-append "foo=" bar) "baz")

Most Guix developers prefer (list ...) because it's more self-explanatory to people unfamiliar with Lisps.  However, 'quoting is such a fundamental building block that it probably matters little in practice.

Your name looks familiar so I'll assume you understand basic Lisps concepts like quote & quasiquote.  If not, I strongly suggest learning the basics, it will make Guix much less mysterious.

As long as configure-flag gets a list, it matters little how you construct it:

  #~(append (list "my" "flags")
            '("are" "many")
           (string-append "colo" "ured"))

Just be consistent.



Kind regards,

T G-R

Sent on the go.  Excuse or enjoy my brevity.


  reply	other threads:[~2023-01-19 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  5:29 #:configure-flags flags #~'() or #:configure-flags flags #~() Feng Shu
2023-01-19  9:27 ` Tobias Geerinckx-Rice [this message]
2023-01-19 11:44   ` Feng Shu
2023-01-19 12:42     ` Tobias Geerinckx-Rice

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=E24751C8-FB89-4F6A-8074-DDA8DEE67ECF@tobias.gr \
    --to=me@tobias.gr \
    --cc=guix-devel@gnu.org \
    --cc=tumashu@163.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).