According to the official documentation the problem (to be solved) is that anonymous methods are managed types, whereas procedural variables are not.
The 'reference to' keyword is more general than the other procedural types.
Here's how the doc puts it: http://docs.embarcadero.com/products/rad_studio/delphiAndcpp2009/HelpUpdate2/EN/html/devcommon/anonymousmethods_xml.html
Anonymous methods are typically assigned to something, as in these examples:
myFunc := function(x: Integer): string
begin
Result := IntToStr(x);
end;
myProc := procedure(x: Integer)
begin
Writeln(x);
end;
Anonymous methods may also be returned by functions or passed as values for parameters when calling methods. For instance, using the anonymous method variable myFunc defined just above:
type
TFuncOfIntToString = reference to function(x: Integer): string;
procedure AnalyzeFunction(proc: TFuncOfIntToString);
begin
{ some code }
end;
// Call procedure with anonymous method as parameter
// Using variable:
AnalyzeFunction(myFunc);
// Use anonymous method directly:
AnalyzeFunction(function(x: Integer): string
begin
Result := IntToStr(x);
end;)
Method references can also be assigned to methods as well as anonymous methods. For example:
type
TMethRef = reference to procedure(x: Integer);
TMyClass = class
procedure Method(x: Integer);
end;
var
m: TMethRef;
i: TMyClass;
begin
// ...
m := i.Method; //assigning to method reference
end;
However, the converse is not true: you can't assign an anonymous method to a regular method pointer. Method references are managed types, but method pointers are unmanaged types. Thus, for type-safety reasons, assigning method references to method pointers is not supported. For instance, events are method pointer-valued properties, so you can't use an anonymous method for an event. See the section on variable binding for more information on this restriction.