From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:37762) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2WsZ-0003Tr-GK for guix-patches@gnu.org; Tue, 27 Aug 2019 04:31:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2WsY-0002GQ-2V for guix-patches@gnu.org; Tue, 27 Aug 2019 04:31:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2WsX-0002GC-SI for guix-patches@gnu.org; Tue, 27 Aug 2019 04:31:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i2WsX-00086m-Mn for guix-patches@gnu.org; Tue, 27 Aug 2019 04:31:01 -0400 Subject: [bug#36919] [PATCH 1/2] gnu-maintenance: KDE updater no longer relies on FTP access. Resent-Message-ID: References: <20190804102856.32609-1-h.goebel@crazy-compilers.com> <20190804102856.32609-2-h.goebel@crazy-compilers.com> <87k1bbcxrc.fsf@gnu.org> From: Hartmut Goebel Message-ID: <80cc20cb-589b-30df-4a3e-896a21d42eba@crazy-compilers.com> Date: Tue, 27 Aug 2019 10:30:32 +0200 MIME-Version: 1.0 In-Reply-To: <87k1bbcxrc.fsf@gnu.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US 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: 36919@debbugs.gnu.org Hi Ludo, thanks for the coding advice. This was what I've been asking for :-) Just one point: Am 17.08.19 um 23:01 schrieb Ludovic Courtès: > As a rule of thumb we don’t use ‘set!’ in Guix, except in special > circumstances. In this case you can write: > > (define (canonicalize-path path) > (cond ((string-prefix? …) > (string-drop path 17)) > ((string-suffix? …) > (string-drop-right path 1)) > …)) AFAIK, `cond` only processes the first expression where `test ` is true. In this case, we need to process *all* cases where the test is true. This means we need to nest the evaluation, which is ugly and hard to read IMHO. Is there some more "linear" syntax? (BTW: The manual [1] is not quite precise on `cond`, so I needed to test it. Maybe I did it wrong.) [1] https://www.gnu.org/software/guile/manual/html_node/Conditionals.html -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |