From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH 1/7] import cran: Remove more invalid characters from package names. Date: Tue, 14 Jun 2016 17:02:56 +0200 Message-ID: References: <1464018008-1767-1-git-send-email-ricardo.wurmus@mdc-berlin.de> <1464018008-1767-2-git-send-email-ricardo.wurmus@mdc-berlin.de> <87lh2s9biz.fsf@gnu.org> 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]:52643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bD4xA-0006nL-C8 for guix-devel@gnu.org; Wed, 15 Jun 2016 03:09:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bD4x7-00066y-4J for guix-devel@gnu.org; Wed, 15 Jun 2016 03:09:32 -0400 In-Reply-To: <87lh2s9biz.fsf@gnu.org> 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org Ludovic Court=C3=A8s writes: > Ricardo Wurmus skribis: > >> * guix/import/cran.scm (guix-name): Replace period and underscore with >> dash; always prepend package names with "r-". > > [...] > >> + (string-append "r-" (string-downcase >> + (regexp-substitute/global #f "(_|\\.)" name >> + 'pre "-" 'post)))) > > I have a preference fro =E2=80=98string-map=E2=80=99, which I find more= readable than > =E2=80=98regexp-substitute/global=E2=80=99 in simple cases. Thoughts? > > Otherwise LGTM! Using =E2=80=9Cstring-map=E2=80=9D is indeed nicer! I=E2=80=99m not a fa= n of =E2=80=9Cregexp-substitute/global=E2=80=9D (and regular expressions in ge= neral), but it didn=E2=80=99t occur to me to use =E2=80=9Cstring-map=E2=80=9D. Thanks f= or the hint. ~~ Ricardo