D Language UFCS - Uniform Function Call Syntax

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • aThirdFun(anotherFun(myFun(), 42); // common notation (also valid)
  • myFun().anotherFun(42).aThirdFun(); // UFCS
  • myFun.anotherFun(42).aThirdFun; // empty braces can be removed

Remarks

In a call a.b(args...), if the type a does not have a method named b, then the compiler will try to rewrite the call as b(a, args...).



Got any D Language Question?