guix-devel
[Top][All Lists]
Advanced

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

Re: #:configure-flags flags #~'() or #:configure-flags flags #~()


From: Tobias Geerinckx-Rice
Subject: Re: #:configure-flags flags #~'() or #:configure-flags flags #~()
Date: Thu, 19 Jan 2023 09:27:08 +0000

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 via email to

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