On 2023-12-07 10:42, Eric Botcazou wrote:
I think from a language standpoint, the general idea that nested
functions are just any functions inside functions (which is how the C
nested functions essentially behave) is too broad and they should be
restricted to minimal implementations that, e.g. don't have side-effects
or if they do, there's explicit syntactic sugar to make it clearer.
That sounds totally arbitrary though. Algol-derived languages have had nested
subprograms for ages, e.g. Pascal or Ada, and they can be very useful.
I'll admit that it is a subjective preference and is probably not in the
spirit of traditional C.
Sid