Liste des Groupes | Revenir à cl c |
On 2025-04-21, bart <bc@freeuk.com> wrote:Read the thread. Nobody has changed their opinion on C for-loops, or agreed with its various problems, or thought that a streamlined loop would be a welcome.I don't now think think there is any argument that will make anyObviously, the former is more primitive, because the second can
difference. People here genuinely think that writing:
>
for (ch = 0; ch <= 255; ++ch)
>
is far superior to this 'primitive' version:
>
do ch = 0, 255
be made out of the first with a preprocessor, whereas the converse
is not true. If A can be made out of B, but B not out of A,
B is more primitive.
The former is undeniably more verbose for the uses provided by the
second.
It is also much more flexible.
Thanks to the macro preprocessor, it can almost express the second form,
just with more punctuation:
for_range (ch, 0, 255)
If a built-in "do" range loop existed in C, it would likely have
the parentheses.
No amount of discussion or arguments will make them change their minds.Mostly, you are projecting onto people opinions they don't actually
have.
You're also not a fan of unbridled language extension, based on yourI don't agree with language-building features. You just end up with a monstrosity like C++.
past opinions about, oh, C++ and whatnot.
Your primary reaction to some new idea is to reject it as complexC23 is nothing particularly interesting. A few features I wont't be able to rely on until I'm dead.
fluff that you'd rather not undertand.
How brushed up are you in using C17 or C23?
You've also expressed oppositions to extending C, becauseAs I said, development of is not that interesting. Basically sticking plaster fixes.
development of C makes it a moving target for your projects.
preprocessing.You can't /just/ add such a macro. To be useful, it has to be standardised. And then, you'd probably need #include <stdunless.h> to use it.
Would you support an "unless" statement being added to C, given
that we can just:
#define unless(x) if(!(x))
Or, unless which does not take else:
#define unless(x) if (x) { } else
Adding a new statement to C is a big deal, compared to someone
adding a macro to their code.
Literally the first question about any proposal for a new languageI think C's macros are the main thing that have hindered its development.
feature is going to be: can obtain that, or substantially obtain it
using existing features
Les messages affichés proviennent d'usenet.