Liste des Groupes | Revenir à cl c |
On 2025-04-22, bart <bc@freeuk.com> wrote:Why use macros at all?On 22/04/2025 20:26, Kaz Kylheku wrote:I identified some macros in there that look gratuitous; you just snippedOn 2025-04-22, bart <bc@freeuk.com> wrote:>>Or would you automatically say it was reasonable no matter how many>
levels there were, just to disagee with me and to side with a fellow C
programmer?
You're trying to say that C is a bad language because you can have
7 or more layers of macro expansion, but you're not considering how
bizarre and crippling restriction it would be to put a cap on it.
Here, I'm trying to determine if this is the poster's honest, objective
opinion, or whether they'd always going to be defend such code no matter
what.
that part.
If you're going to criticize the macros, then hold the code constant.but you're not considering how>
bizarre and crippling restriction it would be to put a cap on it.
There WILL be a cap. Some deep nesting might be justified in special
cases, for example some recursive macro that builds a string a character
at a time.
>
But this was not such a case; it was simply decided to make it work
using macros instead of functions.
If it is a given requirement that some code is to be written or
generated, and we have some macros which do that, are those macros a
"good" or "bad" solution?
Les messages affichés proviennent d'usenet.