Page MenuHomePhabricator

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

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

Diff Detail

Repository
rEFL core/efl
Branch
dotnet
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14397
Build 9914: arc lint + arc unit
brunobelo created this revision.Nov 7 2019, 4:40 AM
brunobelo requested review of this revision.Nov 7 2019, 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.Nov 7 2019, 10:11 AM

fixing error on docs.

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