Sujet : Re: Loops (was Re: do { quit; } else { })
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 22. Apr 2025, 23:02:34
Autres entêtes
Organisation : None to speak of
Message-ID : <87selzyhvp.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Gnus/5.13 (Gnus v5.13)
David Brown <
david.brown@hesbynett.no> writes:
On 22/04/2025 02:12, bart wrote:
[...]
(Only Keith cautiously welcome the idea of such a feature, while MS
said he would vote against it, and JP said they would have proposed
it on April 1st.)
>
I don't recall reading Keith saying any such thing. He said he would
be willing to nit-pick a proposal for a new "for-loop" syntax - not
that he would welcome it. Perhaps he just thinks he would enjoy
nit-picking such a paper. As for using a feature if it were added to
C, I know I probably would do so in my own code - that does not imply
that I think such a feature is needed, or that I have any trouble
using C's current syntax for simple loops. (I find C++'s alternative
for-loop syntax nicer for iterating over containers, but that is not
as easily translatable into C.)
Here's what I wrote:
"""
Again, I would not object to adding a new kind of for loop,
similar to what you would prefer, and visually distinct from the
existing for loop, in a new version of the C standard. But that's
not likely to happen because there doesn't seem to be much demand
for it (for reasons that I know make you angry), and I don't care
enough to write a proposal. If someone else does write a proposal,
I'll be glad to help out by nitpicking it.
"""
I'll accept that "cautiously accept" is close enough to "would not
object".
[...]
I guess I am the exception - I've never needed any of these. But for
your information, C23 has a _Lengthof operator
C23 does not have _Lengthof. It's proposed for C2y.
[...]
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */