[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]
4chanarchives logo

Why doesn't C have lambda expressions or even anonymous functions?You have anonymous


Thread replies: 8
Thread images: 1

File: pfrDlU2.jpg (29KB, 400x240px) Image search: [Google] [Yandex] [Bing]
pfrDlU2.jpg
29KB, 400x240px
Why doesn't C have lambda expressions or even anonymous functions?
You have anonymous structs, unions, enums, why not functions?

Why do enumerated types have to pollute the global namespace, even if they're declared inside of a struct or function?
Oh wait, let me just make it a static type, OOPS now you can't use it anywhere!

And why wasn't array size built into the language?
The standard says nothing about how an implementation was supposed to keep track of it's heap usage, yet it expects it to know the size of a heap pointer to free or resize it.
Why couldn't this have been standardized so you could use it as a foolproof way to determine array length without resorting to stupid shit like null terminators?
>>
>>55135344
C is designed to be as lightweight and close to the metal as possible. I'm sure there are MANY small abstractions they could have used to improve it, but each one would slowly turn it into a clustered mess. You still have function callbacks and can pass them as parameters, so you can still use lambdas and anonymous functions, just with a type and name
>>
>>55135364
>just with type and name

So not anonymous functions?
>>
>>55135344
C was made by cucks who worked in the mail room of a telephone company on their downtime.
>>
>>55135387
There was no such thing as downtime at bell labs because they were never really told to do anything.
>>
>>55136553
Those lads were comphy as fuck
https://www.youtube.com/watch?v=tc4ROCJYbm0
>>
Because C wasn't based on Algol 68.
>>
>>55135364
This. Read the back cover of "The C Programming Language" bible:

>We have tried to retain the brevity of the first edition. C is not a big language, and it is not well served by a big book.
Thread replies: 8
Thread images: 1
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y / ] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
If a post contains illegal content, please click on its [Report] button and follow the instructions.
This is a 4chan archive - all of the content originated from them. If you need information for a Poster - you need to contact them.
This website shows only archived content and is not affiliated with 4chan in any way.
If you like this website please support us by donating with Bitcoin at 1XVgDnu36zCj97gLdeSwHMdiJaBkqhtMK