[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: guix lint false positives and RFC patch
From: |
Maxime Devos |
Subject: |
Re: guix lint false positives and RFC patch |
Date: |
Sat, 28 Jan 2023 22:24:17 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 |
On 28-01-2023 22:07, Vagrant Cascadian wrote:
The other thing I remember being caught up on, which was not a
deal-breaker, per se, was hoping for a way to loop through a bunch of
@SOMETHING things ... I was not happy with:
+ (if (>= (string-length (string-replace-substring
+ (string-replace-substring synopsis "@acronym" "")
+ "@code" ""))
+ 80)
And then adding @command, @file, @acronym, etc. ... using increasingly
nested levels string-replace-substring would eventually become difficult
to read and surely there is a better way!
How about some regex:
(define regexp
(delay (make-regexp "@(code|acronym|file)\\b")))
(define example "stuff @acronym @code @file")
(regexp-substitute/global #f (force regexp) example 'pre "" 'post)
$4 = "stuff ".
Greetings,
Maxime.
OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature