[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: String interpolation
From: |
Paul Eggert |
Subject: |
Re: RFC: String interpolation |
Date: |
Mon, 12 Dec 2016 09:46:05 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 |
Why not just extend "format" so that it allows trailing "...%" in the
format string to mean "argument value spliced here"? After the argument
you can continue on with the format, which must start with the rest of
the conversion specification. E.g.:
(format "Altitude= %" alt ".2f, direction = %" dir ".2f.")
might output "Altitude = 300.57, direction = 240.93."
That way, you can easily replace the expressions without giving them names:
(format "Altitude= %" (+ alt 100) ".2f, direction = %" (- dir) ".2f.")
This should provide the desired benefits without having to do anything
fancy with variable scoping or changing the lexer or whatever.
- Re: RFC: String interpolation, (continued)
- 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
- Re: RFC: String interpolation,
Paul Eggert <=
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/12
- Re: RFC: String interpolation, Ted Zlatanov, 2016/12/12
- Re: RFC: String interpolation, Paul Eggert, 2016/12/12
- Re: RFC: String interpolation, Paul Eggert, 2016/12/12
- Re: RFC: String interpolation, Richard Stallman, 2016/12/13
- Re: RFC: String interpolation, Paul Eggert, 2016/12/13
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/13
- Re: RFC: String interpolation, Paul Eggert, 2016/12/13
- Re: RFC: String interpolation, John Wiegley, 2016/12/13
- Re: RFC: String interpolation, Lars Ingebrigtsen, 2016/12/13