Sujet : Re: C23 thoughts and opinions
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.cDate : 16. Jun 2024, 02:16:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v4lee9$3n6db$5@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
User-Agent : Pan/0.158 (Avdiivka; )
On Sun, 16 Jun 2024 00:20:34 +0100, bart wrote:
On 15/06/2024 23:39, Lawrence D'Oliveiro wrote:
On Sat, 15 Jun 2024 20:27:41 +0100, bart wrote:
The "+" is used for compile-time string/data-string concatenation.)
Why didn’t you follow the C convention of implicit concatenation, just
by placing literals next to each other?
Why is that better?
Less typing. Surprising that few other languages, that otherwise copy
things from C, do not include that feature. But Python does. E.g.
toc.write \
(
"// Total length: %(total_length)s\n"
"CD_DA\n"
"CD_TEXT\n"
" {\n"
" LANGUAGE_MAP { 0 : EN }\n"
" LANGUAGE 0\n"
" {\n"
" TITLE \"%(disc_title)s\"\n"
" PERFORMER \"\"\n"
# get around off-by-one performer assignment bug in cdrdao
" }\n"
" }\n"
%
{
"disc_title" : title_data["disc_title"],
"total_length" : format_cd_time(title_data["total_nr_frames"], True),
}
)
I did actually have that, but it wasn't as useful. It could only work at
the lexical level with actual string literals, for a start.
Of course.