Page MenuHomePhabricator

csharp: Add To and From methods for implicit conversion.
ClosedPublic

Authored by brunobelo on Thu, Nov 7, 4:40 AM.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
brunobelo created this revision.Thu, Nov 7, 4:40 AM
brunobelo requested review of this revision.Thu, Nov 7, 4:40 AM

I have never seen this syntax before. What is this doing?

@segfaultxavi it's lambda,

public int Foo() => 3;

it's the same to

public int Foo()
{
  return 3;
}

also, it can be used to create lambda function like

Func<int, int> square = x => x * x;

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/statements-expressions-operators/lambda-expressions

ahhh, cool. Thanks!

brunobelo updated this revision to Diff 26740.Thu, Nov 7, 10:11 AM

fixing error on docs.

lauromoura accepted this revision.Tue, Nov 12, 1:58 PM
This revision is now accepted and ready to land.Tue, Nov 12, 1:58 PM
This revision was automatically updated to reflect the committed changes.