www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - The pull request of the day: 3998

reply "eles" <eles eles.com> writes:
Hello everybody,

  All D contributors are invited to have a look at this pull 
request. It is fairly important for the D language, as it 
implements the multiple alias this.

  The pull request number: 333998

https://github.com/D-Programming-Language/dmd/pull/3998

  Please focus attention on it today (well, the next 24 hours, it 
depends when your day starts).

  Let's bring'it to a state of: "to be merged" or "to be rejected".

  Many thanks.
Oct 07 2014
parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Tue, Oct 07, 2014 at 03:31:51PM +0000, eles via Digitalmars-d wrote:
 Hello everybody,
 
 All D contributors are invited to have a look at this pull request. It
 is fairly important for the D language, as it implements the multiple
 alias this.
[...] PR of the *day*?? More like PR of the *year*. I've been waiting for multiple alias this for a looong time, ever since I read about it in TDPL. T -- People tell me that I'm paranoid, but they're just out to get me.
Oct 07 2014
parent reply "Jonathan" <jadit2 gmail.com> writes:
What are some "common uses" for multiple aliasing? I understand 
the feature, but curious where it would be commonly employed.

To me, this allows structs to have something like inheritance. 
You add a property for another struct that acts like an interface 
and alias that struct to the current one. Thoughts?
Oct 07 2014
next sibling parent "Jonathan" <jadit2 gmail.com> writes:
Btw, is the C++ equivalent (roughly) to this be the casting 
operator?
http://en.cppreference.com/w/cpp/language/cast_operator
Oct 07 2014
prev sibling next sibling parent ketmar via Digitalmars-d <digitalmars-d puremagic.com> writes:
On Tue, 07 Oct 2014 17:36:22 +0000
Jonathan via Digitalmars-d <digitalmars-d puremagic.com> wrote:

 What are some "common uses" for multiple aliasing? I understand=20
 the feature, but curious where it would be commonly employed.
it was already discussed in this NG.
Oct 07 2014
prev sibling parent reply "Dicebot" <public dicebot.lv> writes:
On Tuesday, 7 October 2014 at 17:36:24 UTC, Jonathan wrote:
 What are some "common uses" for multiple aliasing? I understand 
 the feature, but curious where it would be commonly employed.

 To me, this allows structs to have something like inheritance. 
 You add a property for another struct that acts like an 
 interface and alias that struct to the current one. Thoughts?
Multiple inheritance of implementation for structs + implicit casting in one basket
Oct 07 2014
next sibling parent "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Tue, Oct 07, 2014 at 05:58:40PM +0000, Dicebot via Digitalmars-d wrote:
 On Tuesday, 7 October 2014 at 17:36:24 UTC, Jonathan wrote:
What are some "common uses" for multiple aliasing? I understand the
feature, but curious where it would be commonly employed.

To me, this allows structs to have something like inheritance. You
add a property for another struct that acts like an interface and
alias that struct to the current one. Thoughts?
Multiple inheritance of implementation for structs + implicit casting in one basket
Also, transparent proxying of heterogenous interfaces. TDPL contains an example (or two) of this. T -- Without geometry, life would be pointless. -- VS
Oct 07 2014
prev sibling parent "monarch_dodra" <monarchdodra gmail.com> writes:
On Tuesday, 7 October 2014 at 17:58:41 UTC, Dicebot wrote:
 On Tuesday, 7 October 2014 at 17:36:24 UTC, Jonathan wrote:
 What are some "common uses" for multiple aliasing? I 
 understand the feature, but curious where it would be commonly 
 employed.

 To me, this allows structs to have something like inheritance. 
 You add a property for another struct that acts like an 
 interface and alias that struct to the current one. Thoughts?
Multiple inheritance of implementation for structs + implicit casting in one basket
I wish that's what we used it for. More often than not, it's used to simulate implicit casting, sometimes with catastrophic results in generic code...
Oct 07 2014