Chris Angelico <ros...@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
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to