is(x = module) vs. __traits(isModule, x)

Paul Backus snarwin at gmail.com
Wed Oct 7 18:58:06 UTC 2020


On Wednesday, 7 October 2020 at 18:46:07 UTC, Steven 
Schveighoffer wrote:
> Wrong. They were both added in the *same PR* to mean the *same 
> thing*: https://github.com/dlang/dmd/pull/5290
>
> Is there a reason we want to have both? Why did we want to 
> muddy the `is` waters?

I tried reading through the PR discussion to see how things ended 
up this way.

The original PR includes only the __traits versions. The is() 
version was first proposed in a comment by Timothee Cour [1], and 
supported by several others including Andrei [2]. The PR author 
continues work on an implementation that includes only the is() 
versions, until a few months later, Nicholas Wilson leaves the 
following comment [3]:

> It was decided to have both.

The rationale behind this decision is never elaborated on, and 
the PR is eventually merged with both versions.

[1] https://github.com/dlang/dmd/pull/5290#issuecomment-366826557
[2] https://github.com/dlang/dmd/pull/5290#issuecomment-462884161
[3] https://github.com/dlang/dmd/pull/5290#issuecomment-491509238


More information about the Digitalmars-d mailing list