[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improve `replace-regexp-in-string' ergonomics?
From: |
Thierry Volpiatto |
Subject: |
Re: Improve `replace-regexp-in-string' ergonomics? |
Date: |
Tue, 12 Oct 2021 20:44:23 +0000 |
Juri Linkov <juri@linkov.net> writes:
>> What about providing a simple anaphoric `and`?
>>
>> (let ((bar "bar"))
>> (helm-aand bar
>> (replace-regexp-in-string "b" "f" it)
>> (replace-regexp-in-string "a" "o" it)
>> (replace-regexp-in-string "r" "o" it)))
>> =>"foo"
>
> What does the following return?
>
> (let ((bar "bar"))
> (helm-aand bar
> (replace-regexp-in-string "b" "f" it)
> (replace-regexp-in-string "f" "o" it)))
>
> If it returns "oar" then it applies replacements sequentially,
> and we have no problem with such implementations.
Yes, it does, thought you wanted something easy to read (and write), it
was the initial question isn't it?
> But we need an alternative version that performs simultaneous
> replacements and returns "far".
So I don't understand what you want to achieve.
--
Thierry
signature.asc
Description: PGP signature
- Re: Improve `replace-regexp-in-string' ergonomics?, Juri Linkov, 2021/10/05
- Re: Improve `replace-regexp-in-string' ergonomics?, Juri Linkov, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Lars Ingebrigtsen, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Stefan Monnier, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Lars Ingebrigtsen, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Lars Ingebrigtsen, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Mattias EngdegÄrd, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Stefan Monnier, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Thierry Volpiatto, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?, Juri Linkov, 2021/10/12
- Re: Improve `replace-regexp-in-string' ergonomics?,
Thierry Volpiatto <=
- Re: Improve `replace-regexp-in-string' ergonomics?, Juri Linkov, 2021/10/13
- Re: Improve `replace-regexp-in-string' ergonomics?, Thierry Volpiatto, 2021/10/13