From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRKt9-0005W3-3y for guix-patches@gnu.org; Tue, 19 Dec 2017 11:37:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRKt4-0002W4-GB for guix-patches@gnu.org; Tue, 19 Dec 2017 11:37:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:33843) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRKt4-0002Vo-9n for guix-patches@gnu.org; Tue, 19 Dec 2017 11:37:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eRKt4-0007LJ-39 for guix-patches@gnu.org; Tue, 19 Dec 2017 11:37:02 -0500 Subject: [bug#29745] [PATCH 0/3] Disallow phase returning . Resent-Message-ID: References: <20171216231242.12032-1-arunisaac@systemreboot.net> <87efnt9tvw.fsf@gnu.org> <87zi6gxy6a.fsf@gnu.org> From: Ricardo Wurmus In-reply-to: <87zi6gxy6a.fsf@gnu.org> Date: Mon, 18 Dec 2017 09:44:13 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Message-ID: <87o9mwmnmq.fsf@elephly.net> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 29745@debbugs.gnu.org Ludovic Court=C3=A8s writes: > Hello, > > Arun Isaac skribis: > >> Ludovic Court=C3=A8s writes: >> >>> it ends up defining a notion of =E2=80=9Ctrue=E2=80=9D that=E2=80=99s d= ifferent from that of >>> Scheme (in Scheme, #f is the only false value; everything else is >>> true, including =E2=80=9Cthe unspecified value=E2=80=9D=E2=80=94see =E2= =80=9CDisjointness of types=E2=80=9D in >>> the R5RS.) >> >> I agree. I don't think we should define a new notion of "true" that is >> different from that of Scheme. >> >> But, in that case, why do we explicitly add #t at the end of phases that >> return an unspecified value? Can we not drop this convention and simply >> accept unspecified values from phases as a success of that phase? >> >> The way it is right now, we add #t at the end of phases that return an >> unspecified value, but don't check for this anywhere. So, we have a lot >> of custom phases where people have forgotten to return #t. Patches 2 and >> 3 fix some of these, but I'm sure there are many more. Wouldn't it be >> simpler and more logical to accept unspecified values as "true" in line >> with Scheme's notion of "true"? > > That=E2=80=99s a good question. My take on it is that it=E2=80=99s clear= er: the return > value of =E2=80=98substitute*=E2=80=99 for instance is unspecified, it=E2= =80=99s not necessarily > *the* unspecified value. > > I=E2=80=99m not opposed to changing things though. For instance we could= change > the return value of =E2=80=98substitute*=E2=80=99 to be #t on success; si= milarly for > =E2=80=98install-file=E2=80=99. I would like to change the return value for these two things. It would be good for =E2=80=9Csubstitute*=E2=80=9D to return #f when a pattern could= not be matched, but this would require a few changes to a number of packages where we replace a pattern in many files at once. -- Ricardo GPG: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC https://elephly.net