From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Wingo Subject: Re: question regarding substitute* and #t Date: Wed, 24 Jan 2018 16:27:06 +0100 Message-ID: <87tvvb6zw5.fsf@igalia.com> References: <20180124010802.18874.3012@vcs0.savannah.gnu.org> <20180124010803.590AF2068F@vcs0.savannah.gnu.org> <874lnbzck5.fsf_-_@netris.org> <87372v8ndd.fsf_-_@igalia.com> <72d8803f-0a3d-4d31-e8c8-a5e4be9f45e3@crazy-compilers.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41486) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeMxN-0000gu-9z for guix-devel@gnu.org; Wed, 24 Jan 2018 10:27:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eeMxH-00050r-H7 for guix-devel@gnu.org; Wed, 24 Jan 2018 10:27:21 -0500 Received: from pb-sasl1.pobox.com ([64.147.108.66]:63896 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eeMxH-000508-D0 for guix-devel@gnu.org; Wed, 24 Jan 2018 10:27:15 -0500 In-Reply-To: <72d8803f-0a3d-4d31-e8c8-a5e4be9f45e3@crazy-compilers.com> (Hartmut Goebel's message of "Wed, 24 Jan 2018 15:45:38 +0100") 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: Hartmut Goebel Cc: guix-devel@gnu.org On Wed 24 Jan 2018 15:45, Hartmut Goebel writes: > Am 24.01.2018 um 13:14 schrieb Andy Wingo: >> On Wed 24 Jan 2018 13:06, Mark H Weaver writes: >> >>> + ;; Install to the right directory >>> + (substitute* '("Makefile" >>> + "Qsci/Makefile") >>> + (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") >>> + (assoc-ref outputs "out"))) >>> + #t))))) >> I guess once we switch over all instances of "system" and "system*" to >> use invoke, does that mean we will also be able to remove these >> vestigial "#t" returns? > I wonder why substitute* not simply returns #t?! There was a proposal to make it return #t! However then someone pointed out that actually instead of making phases return boolean results, we should instead signal problems via exceptions, and that drove the shift from system / system* to invoke. In the future world where completion means success, it doesn't matter what substitute* returns. However! Because it doesn't matter, perhaps in the interest of transition we should make substitute* return #t, so that once we switch to the new exception-based error signalling, that we have less code to clean up later. Andy