I have a question about lambda function.
In example below the code it is a lambda function in Delphi?
var
Lambda: TFunc<Integer, Integer>;
begin
Lambda:= function(ANumber: Integer) : Integer
begin
Result:= ANumber * ANumber;
end;
ShowMessage(Lambda(2).ToString());
ShowMessage(Lambda(4).ToString());
end;
Thanks
In Delphi terminology that is an anonymous function. In some languages they are known as Lambda functions. So yes, this is a Lambda function.
This is Wikipedia's take on the subject: http://en.m.wikipedia.org/wiki/Anonymous_function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With