Re: emulate with

2019-06-01 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 31 May 2019 at 08:35:23 UTC, Simen Kjærås wrote: With 1), 2) and 3) fixed, the code would look like this (only changed code included): unittest { with (Dispatcher.X) { A(1); A("a"); B(2); C_Q(3); } } struct Dispatcher { struct opDispatch(s

Re: emulate with

2019-05-31 Thread Amex via Digitalmars-d-learn
On Friday, 31 May 2019 at 08:35:23 UTC, Simen Kjærås wrote: On Friday, 31 May 2019 at 07:17:22 UTC, Amex wrote: What I'm talking about is that if A would be dispatched to, say, W!X where W handles the special dispatching by returning X_A rather than X.A. I don't know if D can do this kinda s

Re: emulate with

2019-05-31 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 31 May 2019 at 07:17:22 UTC, Amex wrote: What I'm talking about is that if A would be dispatched to, say, W!X where W handles the special dispatching by returning X_A rather than X.A. I don't know if D can do this kinda stuff even though it would be rather simple as it would depen

Re: emulate with

2019-05-31 Thread KnightMare via Digitalmars-d-learn
imo for parts of names such things will never appear.. names, subnames, overloading.. hell no but I want Kotlin lambdas https://kotlinlang.org/docs/reference/lambdas.html I want more: Function literals with receiver it: implicit name of a single parameter Passing a lambda to the last parameter t