Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 10, 2014 DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
I've created DIP for my pull request. DIP: http://wiki.dlang.org/DIP66 PR: https://github.com/D-Programming-Language/dmd/pull/3998 Please, comment it. |
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to IgorStepanov | On 10/10/14 1:09 PM, IgorStepanov wrote:
> I've created DIP for my pull request.
> DIP: http://wiki.dlang.org/DIP66
> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>
> Please, comment it.
Hm... not sure you need a DIP.
From page 231 of TDPL: "A class could introduce any number of alias this declarations, thus subtyping any number of types."
-Steve
|
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Friday, 10 October 2014 at 17:31:23 UTC, Steven Schveighoffer wrote:
> On 10/10/14 1:09 PM, IgorStepanov wrote:
>> I've created DIP for my pull request.
>> DIP: http://wiki.dlang.org/DIP66
>> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>>
>> Please, comment it.
> Hm... not sure you need a DIP.
>
> From page 231 of TDPL: "A class could introduce any number of alias this declarations, thus subtyping any number of types."
>
> -Steve
TDPL tells that multiple alias this should be allowed, but tell nothing about conflict resolving. General idea of this DIP is sistematize rules for alias this. Please comment this part. Maybe I've forgot some cases, maybe introduce dangerous semantic rule.
|
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On Friday, 10 October 2014 at 17:31:23 UTC, Steven Schveighoffer wrote: > On 10/10/14 1:09 PM, IgorStepanov wrote: >> I've created DIP for my pull request. >> DIP: http://wiki.dlang.org/DIP66 >> PR: https://github.com/D-Programming-Language/dmd/pull/3998 >> >> Please, comment it. > Hm... not sure you need a DIP. > > From page 231 of TDPL: "A class could introduce any number of alias this declarations, thus subtyping any number of types." > > -Steve Igor was asked to write a DIP for it by Walter and Andrei. Here's the context: https://github.com/D-Programming-Language/dmd/pull/3998#issuecomment-58286631 |
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to IgorStepanov | On 10/10/14, 10:09 AM, IgorStepanov wrote:
> I've created DIP for my pull request.
> DIP: http://wiki.dlang.org/DIP66
> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>
> Please, comment it.
Thanks, will do. Everybody interested please chime in! -- Andrei
|
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Steven Schveighoffer | On 10/10/14, 10:31 AM, Steven Schveighoffer wrote:
> On 10/10/14 1:09 PM, IgorStepanov wrote:
>> I've created DIP for my pull request.
>> DIP: http://wiki.dlang.org/DIP66
>> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>>
>> Please, comment it.
> Hm... not sure you need a DIP.
>
> From page 231 of TDPL: "A class could introduce any number of alias
> this declarations, thus subtyping any number of types."
TDPL is not reference. The DIP should cover various corner cases. -- Andrei
|
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 10/10/14 2:17 PM, Andrei Alexandrescu wrote:
> On 10/10/14, 10:31 AM, Steven Schveighoffer wrote:
>> On 10/10/14 1:09 PM, IgorStepanov wrote:
>>> I've created DIP for my pull request.
>>> DIP: http://wiki.dlang.org/DIP66
>>> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>>>
>>> Please, comment it.
>> Hm... not sure you need a DIP.
>>
>> From page 231 of TDPL: "A class could introduce any number of alias
>> this declarations, thus subtyping any number of types."
>
> TDPL is not reference. The DIP should cover various corner cases. -- Andrei
>
OK, thanks everyone. I thought DIPs were specifically for proposals that had not been already approved.
-Steve
|
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to IgorStepanov | On Friday, 10 October 2014 at 17:09:08 UTC, IgorStepanov wrote:
> I've created DIP for my pull request.
> DIP: http://wiki.dlang.org/DIP66
> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>
> Please, comment it.
There is an error in the wiki formatting in the second code block. (`{| class="wikitable"` should not be there)
I don't see any problems with the actual content of the DIP.
|
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to IgorStepanov | On Friday, 10 October 2014 at 17:09:08 UTC, IgorStepanov wrote: > I've created DIP for my pull request. > DIP: http://wiki.dlang.org/DIP66 > PR: https://github.com/D-Programming-Language/dmd/pull/3998 > > Please, comment it. I understand that as a first step it was suggested to implement the strictest behaviour regarding conflicts, namely to disallow them entirely. However, I think more permissive strategies are useful, like in this example: https://github.com/D-Programming-Language/dmd/pull/3998#issuecomment-58570742 Conflict resolution can work like overload resolution, with different levels of matching and partial ordering. |
October 10, 2014 Re: DIP66 - Multiple alias this | ||||
---|---|---|---|---|
| ||||
Posted in reply to IgorStepanov | On 10/10/14 1:09 PM, IgorStepanov wrote:
> I've created DIP for my pull request.
> DIP: http://wiki.dlang.org/DIP66
> PR: https://github.com/D-Programming-Language/dmd/pull/3998
>
> Please, comment it.
This part:
void test()
{
C c;
int i = c; //Error: c.a.i vs c.b.i
}
static assert(is(C : int)); //Ok, because C is subtype of int anyway.
I think might be wrong. There is a lot of code out there that says, e.g.:
void foo(T)(T t) if(is(T : U))
{
U u = t;
...
}
Which will now create an error in the wrong place. IMO, the 'is' test should also fail.
-Steve
|
Copyright © 1999-2021 by the D Language Foundation