Ludovic Courtès <l...@gnu.org> writes:

> Ricardo Wurmus <ricardo.wur...@mdc-berlin.de> 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 ‘string-map’, which I find more readable than
> ‘regexp-substitute/global’ in simple cases.  Thoughts?
>
> Otherwise LGTM!

Using “string-map” is indeed nicer!  I’m not a fan of
“regexp-substitute/global” (and regular expressions in general), but it
didn’t occur to me to use “string-map”.  Thanks for the hint.

~~ Ricardo

Reply via email to