Re: Can you get typeof(this) in a mixin template - trying to mimic a Kotlin feature here.

2018-08-29 Thread aliak via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 20:58:23 UTC, Alex wrote: Isn't the problem, that inside a template a declaration is expected, and not a foreach? Boh, you're right. I guess I misunderstood mixin templates. Found a way with a normap function though :p void mapSelf(alias self, alias aa)()

Re: Solving the impossible?

2018-08-29 Thread Kagamin via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 20:37:05 UTC, Everlast wrote: the second one seems better. Simpler, more direct, more obvious, and inline with the standard non variadic syntax. The ellipses pretty much state that we are dealing with an array, no reason to add redundancy. That's not obvious,

Mimicking IID_PPV_ARGS

2018-08-29 Thread Cody Duncan via Digitalmars-d-learn
From C++ #define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType) //ComPtr version ComPtr debugController; if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS( { // do stuff } //Raw Pointer Version ID3D12Debug* debugController; if

Re: Mimicking IID_PPV_ARGS

2018-08-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/29/18 5:51 AM, Cody Duncan wrote: From C++ #define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType) //ComPtr version ComPtr debugController; if (SUCCEEDED(D3D12GetDebugInterface(IID_PPV_ARGS( { // do stuff } //Raw Pointer Version ID3D12Debug*

Re: Solving the impossible?

2018-08-29 Thread Everlast via Digitalmars-d-learn
On Tuesday, 28 August 2018 at 22:01:45 UTC, Paul Backus wrote: On Tuesday, 28 August 2018 at 20:37:05 UTC, Everlast wrote: Also, the biggest complaint is that when we use [] attached to a type it has a specific meaning as "an array of". e.g., int[] means an array of int's. But int[] a...

Re: Solving the impossible?

2018-08-29 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote: One of the things that makes a good language is it's internal syntactic consistency. This makes learning a language easier and also makes remembering it easier. Determinism is a very useful tool as is abstraction consistency. To say

Re: Solving the impossible?

2018-08-29 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 22:18:09 UTC, Everlast wrote: No it is not! you have simply accepted it to be fact, which doesn't make it consistent. If you take 100 non-programmers(say, mathematicians) and ask them what is the natural extension of allowing an arbitrary number of parameters

Re: Solving the impossible?

2018-08-29 Thread Everlast via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 21:14:59 UTC, Paul Backus wrote: On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote: One of the things that makes a good language is it's internal syntactic consistency. This makes learning a language easier and also makes remembering it easier.

Re: Mimicking IID_PPV_ARGS

2018-08-29 Thread Cody Duncan via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 16:17:13 UTC, Steven Schveighoffer wrote: On 8/29/18 5:51 AM, Cody Duncan wrote: From C++ #define IID_PPV_ARGS(ppType) __uuidof(**(ppType)), IID_PPV_ARGS_Helper(ppType) //ComPtr version ComPtr debugController; if

Re: Solving the impossible?

2018-08-29 Thread vit via Digitalmars-d-learn
On Wednesday, 29 August 2018 at 19:56:31 UTC, Everlast wrote: On Tuesday, 28 August 2018 at 22:01:45 UTC, Paul Backus wrote: [...] One of the things that makes a good language is it's internal syntactic consistency. This makes learning a language easier and also makes remembering it easier.