[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: String interpolation
From: |
Stefan Monnier |
Subject: |
Re: RFC: String interpolation |
Date: |
Mon, 12 Dec 2016 08:03:41 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) |
> (let ((thing-formatted (replace-regexp-in-string " +" " " thing)))
> (fmt "This is %{thing-formatted}.2f"))
>
> That is, you're forced to both name and introduce a new temporary
> variable, and you have to alter the format statement itself. (This is
> what PHP programmers do all the time, and it kinda sucks.)
I see no need for renaming and altering the format statement itself:
(let ((thing (replace-regexp-in-string " +" " " thing)))
(fmt "This is %{thing}.2f"))
> (fmt "This is %{thing}.2f"
> :thing (replace-regexp-in-string " +" " " thing))
>
> This sucks slightly less, in my opinion.
I still don't see much difference.
Stefan
- Re: RFC: String interpolation, (continued)
- Re: RFC: String interpolation, Stefan Monnier, 2016/12/11
- Re: RFC: String interpolation, Richard Stallman, 2016/12/11
- Re: RFC: String interpolation, Clément Pit--Claudel, 2016/12/11
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/11
- Re: RFC: String interpolation, Richard Stallman, 2016/12/12
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/11
- Re: RFC: String interpolation, Helmut Eller, 2016/12/11
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/11
- Re: RFC: String interpolation, Stefan Monnier, 2016/12/11
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/12
- Re: RFC: String interpolation,
Stefan Monnier <=
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/12
- Re: RFC: String interpolation, Stefan Monnier, 2016/12/12
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/12
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/12
- Re: RFC: String interpolation, Stefan Monnier, 2016/12/12
- Re: RFC: String interpolation, Stefan Monnier, 2016/12/12
- Re: RFC: String interpolation, Clément Pit--Claudel, 2016/12/12
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/12
- Re: RFC: String interpolation, Clément Pit--Claudel, 2016/12/12
- Re: RFC: String interpolation, Stefan Monnier, 2016/12/12