unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Andreas Enge <andreas@enge.fr>
Cc: guix-devel@gnu.org
Subject: Re: Using #true and #false everywhere?
Date: Tue, 20 Oct 2020 13:10:25 +0200	[thread overview]
Message-ID: <871rhtw3tq.fsf@elephly.net> (raw)
In-Reply-To: <20201020103244.GB6805@jurong>


Andreas Enge <andreas@enge.fr> writes:

> And since we are on the bikeshedding front, I feel like writing a second
> message.
>
> On Fri, Oct 16, 2020 at 12:38:23PM +0200, Ludovic Courtès wrote:
>> As discussed on IRC recently, several of us think that using “#true” and
>> “#false” instead of “#t” and “#f” throughout or documentation and code
>> would probably make it easier for newcomers to decipher that.
>
> Honestly, I think either of them is sufficiently easy to understand, in the
> presence of much more difficult questions:
> - The "non-typedness of booleans": Does "(if 1 2 3)" raise an exception or
>   work, and if the latter is true, what is the result? And if I replace
>   "1" by "0" or the empty list? (In Guix, this is related to the question:
>   Do I need to add #t or #f at the end of a phase, or is the value of its
>   last statement sufficient?)

I think it’s very ugly that we still need to end phases with #T, even
though build systems don’t care any more.  The only thing that aborts a
build phase now is an exception.  In the next core-updates cycle we
should probably remove the warning about ending build phases with
anything other than #T and then remove all spurious #Ts from existing
package definitions.

> - What are quotes, quasiquotes, unquotes? How do they relate to code staging
>   in Guix? (This is to me the most difficult part of Guix code, in particular
>   for someone coming from a language where code is code and data are
>   data.)

It’s tricky.  I found the toggle switch imagery (taken from “The Land of
Lisp”) to be a very useful teaching aid, but it isn’t necessarily
obvious to newcomers *why* we would want to quote code anyway.

> - Actually, why are there two ways to define literal lists? Do they have
>   the same result? This is a mixture of the previous two questions; try
>      (eq? '(1) '(1))
>   vs.
>      (eq? '(1) (list 1))
>   or
>      (eq? (list 1) (list 1))
>   Then try again with eqv? and equal?.
>   Then try again with "(eq? '() (list))" and so on. (This one still
>   surprises me.)
>   Does it matter? (Probably not much in the context of Guix.)

Comparison with EQ? is rarely useful in the context of Guix, because we
usually don’t care about identity (“is the value behind this variable
name and the value behind this other variable name one and the same,
i.e. are the variables just aliases of an identical value?”)  but about
equivalence (“does evaluating this expression lead to the same result as
evaluating this other expression?”).

The difference between a quoted list literal and an expression using
LIST is that the former is immutable whereas the latter is mutable.  The
resulting value is equivalent, but the values themselves are not
identical.

> - If I want to know what are and what happens in the phases of
>   the perl build system, do I look in build/perl-build-system.scm or
>   build-system/perl.scm? Why is there no build-system/perl-build-system.scm
>   or build/perl.scm instead? (Just a little trolling at the end of my post,
>   no real harm intended ;-) But I am honestly unable to remember the answer,
>   and look at the two files every time I wonder about a build system, which
>   is of course entirely feasible, some might even argue
>   instructional.)

Hah, I also always look at both files!  But the simple answer is that
everything in guix/build/* is build-side code, not host code.

-- 
Ricardo


  reply	other threads:[~2020-10-20 11:12 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 10:38 Using #true and #false everywhere? Ludovic Courtès
2020-10-16 13:19 ` Maxim Cournoyer
2020-10-16 13:36   ` Tobias Geerinckx-Rice
2020-10-18  1:36     ` Maxim Cournoyer
2020-10-18  2:22       ` Bengt Richter
2020-10-19 20:45       ` zimoun
2020-10-21  9:56         ` Ludovic Courtès
2020-10-20  9:57     ` Andreas Enge
2020-10-21  9:59       ` Ludovic Courtès
2020-10-21 11:21         ` Andreas Enge
2020-10-21 15:52           ` Ludovic Courtès
2020-10-21 11:51         ` Roel Janssen
2020-10-16 16:24 ` Vagrant Cascadian
2020-10-16 23:45 ` Danny Milosavljevic
2020-10-20 10:32 ` Andreas Enge
2020-10-20 11:10   ` Ricardo Wurmus [this message]
2020-10-20 12:02     ` zimoun
2020-10-20 12:59       ` Tobias Geerinckx-Rice
2020-10-20 13:11         ` zimoun
2020-10-20 13:32           ` Tobias Geerinckx-Rice
2020-10-20 14:26             ` zimoun
2020-10-20 15:48               ` Taylan Kammer
2020-10-21  1:25     ` Mark H Weaver
2020-10-21  6:18       ` Ricardo Wurmus
2020-10-21 10:04         ` Ludovic Courtès
2020-10-20 12:45   ` zimoun
2020-10-20 12:55     ` Andreas Enge
2020-10-21 10:20   ` Ludovic Courtès
2020-10-24 18:29 ` Robin Templeton
  -- strict thread matches above, loose matches on Subject: below --
2020-10-16 22:06 Miguel Ángel Arruga Vivas
2020-10-17  0:25 ` jbranso

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=871rhtw3tq.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=andreas@enge.fr \
    --cc=guix-devel@gnu.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 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).