From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/1] Factor out a common pattern into a procedure. Date: Sun, 19 Oct 2014 19:45:47 +0200 Message-ID: <87r3y4x8ac.fsf@gnu.org> References: <168a3c777e9011635e3a99fb042253e4d0ca324a.1413685080.git.ian@zenhack.net> <20141019074036.GA4382@jocasta.intra> <8761fg1jr6.fsf@gnu.org> <877fzwruge.fsf@yeeloong.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfuY3-0003Tg-1i for guix-devel@gnu.org; Sun, 19 Oct 2014 13:45:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XfuXy-0008PZ-Dv for guix-devel@gnu.org; Sun, 19 Oct 2014 13:45:42 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:36081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XfuXy-0008PT-6S for guix-devel@gnu.org; Sun, 19 Oct 2014 13:45:38 -0400 In-Reply-To: <877fzwruge.fsf@yeeloong.lan> (Mark H. Weaver's message of "Sun, 19 Oct 2014 10:43:29 -0400") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver Cc: guix-devel@gnu.org Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> John Darrington skribis: >> >>> How about something like (string-take-fields "1.22.3.04.5" 3) which wou= ld return "1.22.3" >> >> Agreed. What =E2=80=98version-prefix=E2=80=99, with the optional argume= nt defaulting >> to 2? > > I also like 'version-prefix', although I'd favor making it a required > argument. The improved code clarity is well worth two extra characters. OK, let=E2=80=99s do that. Ian: could you post an updated patch? Thanks, Ludo=E2=80=99.