Sujet : Re: Command line globber/tokenizer library for C?
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 13. Sep 2024, 13:25:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240913152500.00001863@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Fri, 13 Sep 2024 14:12:32 +0200
Bonita Montero <
Bonita.Montero@gmail.com> wrote:
Am 13.09.2024 um 10:38 schrieb Michael S:
On Fri, 13 Sep 2024 07:28:34 +0200
Bonita Montero <Bonita.Montero@gmail.com> wrote:
Am 12.09.2024 um 21:38 schrieb Michael S:
Callback is as easy in C as in C++.
>
Absolutely not because callbacks can't have state in C.
>
So what is 'context' parameter in my code?
In C++ the state is an own internal "this"-like object and you dont't
need any explicit parameters.
So, do you admit that callback in C can have state?
Just a [&] and the lambda refers to the whole outer context.
Bad software engineering practice that easily leads to incomprehensible
code.
When in C++ and not in mood for C-style, I very much prefer functors.
Ideologically they are the same as C-style context, but a little
sugarized syntactically.