[fpc-devel] Delphi anonymous methods
Graeme Geldenhuys
graeme at geldenhuys.co.uk
Mon Mar 4 11:17:47 CET 2013
On 2013-03-04 09:24, Marco van de Voort wrote:
>
> In Delphi, synchronization primitives like queue() and synchronize() have
> been adapted to work with them, so they are actually more used than some
> other new features.
Sure, just like Delphi implemented Advanced Records, when the Object
type already does the exact same thing! Was "advanced records" really
needed, NO. Just because Embarcadero starting using there duplicated
functionality, doesn't make it good, or better than what existed before.
Here is an example
Does the following make sense?
http://docwiki.embarcadero.com/Libraries/XE3//en/System.IOUtils.TDirectory
TDirectory = record
...
class procedure Blablabla(...)
end;
HINT:
Proof that Embarcadero lost the plot, when you read "class procedure",
but it is defined in a record, and not a class? Also, the TDirectory
implementation could just as easily have been defined in a Class with
class methods, and the actually usage would have been exactly the same
[and made more sense]. Thus no need for the "advanced record" rubbish.
It is a duplication of the functionality in a Class and Object type.
Thus, isn't anonymous method just a bad and duplicate implementation of
method pointers. Passing methods to functions etc.?
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
More information about the fpc-devel
mailing list