Sujet : Re: Loops (was Re: do { quit; } else { })
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 22. Apr 2025, 22:40:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250422142113.403@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-04-22, bart <
bc@freeuk.com> wrote:
On 22/04/2025 20:26, Kaz Kylheku wrote:
On 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.
I identified some macros in there that look gratuitous; you just snipped
that part.
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 you're going to criticize the macros, then hold the code constant.
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?
If you think some other code shoud be written or generated, and not
the code produced by those macros, or equivalent to it, then that
doesn't speak to those macros.
It looks like that Lua VM is doing way too much work just to dispatch
an opcode, but if we take that crud as a given, the layers of macros may
be a bad way to obtain it, out of all the alternatives. A somewhat
cleaned up version of those macros would likely be better.
I don't think Lua is very good; I would never choose it for anything, or
basically go anywhere near it. I'm not even slightly surprised the code
is grotty.
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca