On Friday, 12 January 2018 at 13:04:30 UTC, aliak wrote:
On Friday, 12 January 2018 at 10:55:53 UTC, Seb wrote:
On Friday, 12 January 2018 at 00:16:07 UTC, aliak wrote:
Hi, so basically is there a way to:
void func(alias pred = null, Range)(Range range) {
// 1) check if pred(ElementType!Range.init,
ElementType!Range.init) is equality
// 2) check if isUnary!pred
// 3) check if isBinary!pred
}
[...]
It isn't possible yet, but will be very soon:
https://github.com/dlang/dmd/pull/7484
Thats to compare whether lambdaA == lambdaB right? Not if
lambda(a, b) == lambda(b, a) == true <- i guess this is not
possible anyway without knowing the entire set of inputs)
Yes. The implementation is actually pretty straight-forward:
Serialize to AST and compare.