Functional programming

Marko Rauhamaa marko at pacujo.net
Tue Mar 4 22:43:05 CET 2014


Chris Angelico <rosuav at gmail.com>:

> C++ at least has typedefs, and in the newer standards, the 'auto'
> keyword was repurposed.

Last I checked, C++ had no satisfactory way to express
callbacks/functors/listeners/lambdas. That's why Qt came up with a
metacompiler to supplement C++'s facilities.

No, STL and Boost can't remedy the situation.

The main reason was the unfortunate way method pointers were defined in
C++. C#'s delegates and Java's anonymous inner classes are something a
C++ developer can only dream of (unless something has already been
dreamt up in a recent standard).

Python, of course, has delegates:

   that_object.register_callback(self.handle_it)

Python doesn't have anonymous inner classes, but it has named inner
classes, and that's quite sufficient.


Marko



More information about the Python-list mailing list