From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: Why should build phases not return unspecified values? Date: Sun, 17 Dec 2017 15:10:19 +0800 Message-ID: <87tvwpvnhg.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eQT5u-0001xi-Im for guix-devel@gnu.org; Sun, 17 Dec 2017 02:10:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eQT5q-0001HH-9T for guix-devel@gnu.org; Sun, 17 Dec 2017 02:10:42 -0500 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:38329) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eQT5q-0001FL-1w for guix-devel@gnu.org; Sun, 17 Dec 2017 02:10:38 -0500 Received: by mail-pf0-x243.google.com with SMTP id u25so8410104pfg.5 for ; Sat, 16 Dec 2017 23:10:37 -0800 (PST) In-Reply-To: (Arun Isaac's message of "Sun, 17 Dec 2017 04:58:15 +0530") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Arun Isaac Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain Arun Isaac writes: > Whenever we have a build phase that ends with a call (for example, to > substitute, chdir, symlink, etc) that returns an unspecified value, we > append a #t so that the return value is a boolean. However, the build > system, as it stands currently, does not mind an unspecified value, and > treats it as a success. As a result, forgetting to add a #t at the end > of custom phases is a common mistake. To fix this, I have submitted a > patch at https://debbugs.gnu.org/cgi/bugreport.cgi?bug=29745 that > modifies the build system to reject unspecified values as > failures. > > However, IMO, the addition of #t at the end of certain phases, does not > contribute anything of value and we should simply be at peace with > phases returning unspecified values. Am I missing something here? > > WDYT? I think the problem is that when the scheme standard says "the returned value is unspecified", it means anything can be returned. In this case, guile choose to return an unspecified value to avoid returning an arbitary value. I think the answer written by soegaard in [0] explains it pretty well. [0]: https://stackoverflow.com/questions/28910911/detecting-unspecified-in-scheme-list --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEdZDkzSn0Cycogr9IxYq4eRf1Ea4FAlo2GFwACgkQxYq4eRf1 Ea6w8Q//bV7R7WteOo6zkeV+MD1XAR4Yj/1ltUV9Bnyr8N8YCd6LiEH9T5CJGOWR oEIp7S418+p8TLPq9l1d81J+c3qq336CaEw14OO0Px2TrKIPPT7Yi5P1hD0YC3Bg GfAU/Vn/RNSHPVsvq0aVwSnTqE85cTeWzXOFhE4CqCDQy31QhXnGVZ+lrfYZWBF8 zpJHaIhJRGda39Hs9smfzEWNtKoD9qiP9CylAnWASeIGtYtxOdGO0WeuKT0WWwpX Vml8Lu1ItpGxD9hWFEd9lUb/jZWz4IWooCozKYJeQlmOLx/THXZrvD9n47xJpwte FeENRplZmwoQBACO7a5g3Jnlo5vncmyHgmfu3j3fICHdY0tuUYVGOkck8ZtP65BF VnrfMDG03ml4FDy/4wWslE3TOb3XJLiL4ElIM75Ph1LnAYTPBdJ/9/WySawnijfJ hsYqN3bi/OMKtIWBS5QH62wDPMAPBNX0Mb16fa8xK6PsReONtnPdpECxtzNTuA0V dTVUcMEV3VJRj13sm99jl69JA/GgShwOlsHSvikgd2rBRUGGbATOf9aqxRse6BrR lDhIGYd3IvyO52ee5bwuTW6GgOyJihMB5vSArpHZp0xd9ercG8dUHnKP8UFJqm9E d/92nbthUzP8wgCY61HvdN9aJC8pPMW9FqJ4GxCIXcxHGHUYB+A= =h5vt -----END PGP SIGNATURE----- --=-=-=--