3 ms·
> I don't think annonymous functions have anything special to do with FP or OO for that matter. Maybe someone can fill in on this? Anonymous functions are of n
by Ace17 10y ago
> I don't think annonymous functions have anything special to do with FP or OO for that matter. Maybe someone can fill in on this?
Anonymous functions are of no use until functions are first-class citizens (otherwise, there's no way to call them!), and this has always been the case in FP languages.
I do agree though that the focus on mathematical "purity" is a much more defining characteristic of FP.
- rbehrends 10y agoClosures were an integral part of Smalltalk's design. And functions as first class citizens is not a particularly high bar. I mean, C has higher order functions.
- opvasger 10y agoI'm excited to use higher-order functions in C someday :)
- rbehrends 10y agoYou can do that now. Higher-order functions are simply functions that can take other functions as parameters or return them as results. C has been able to do that since forever. It's not something fancy: pretty much every programming language has something along these lines. What is rarer is closures, but that's a different concept. You can have higher-order functions without having closures.
- opvasger 10y agoHaha - I'm simply stating that I'm excited to do it and not for it to be possible :P
- opvasger 10y agoC# & Java has anonymous functions, but not 1st-class functions AFAIK EDIT: but then again, they truely are of no use :P hehe