Anonymous methods in Delphi give us two things.
The first is the ability to write method code inline - passing it directly as a parameter to another method (function/procedure) or directly assigning it to a variable of the appropriate anonymous method type.
The second one is the ability to capture (use in method body) variables from the context in which a particular anonymous method is defined. This is especially useful for various callback and task related patterns because we can stan
Weiterlesen...