Discussion:
The pull request of the day: 3998
eles via Digitalmars-d
2014-10-07 15:31:51 UTC
Permalink
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.
H. S. Teoh via Digitalmars-d
2014-10-07 16:34:09 UTC
Permalink
Post by eles via Digitalmars-d
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.
Jonathan via Digitalmars-d
2014-10-07 17:36:22 UTC
Permalink
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?
Jonathan via Digitalmars-d
2014-10-07 17:40:17 UTC
Permalink
Btw, is the C++ equivalent (roughly) to this be the casting
operator?
http://en.cppreference.com/w/cpp/language/cast_operator
ketmar via Digitalmars-d
2014-10-07 17:53:55 UTC
Permalink
On Tue, 07 Oct 2014 17:36:22 +0000
Post by Jonathan via Digitalmars-d
What are some "common uses" for multiple aliasing? I understand
the feature, but curious where it would be commonly employed.
it was already discussed in this NG.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141007/62c8d4f2/attachment.sig>
Dicebot via Digitalmars-d
2014-10-07 17:58:40 UTC
Permalink
Post by Jonathan via Digitalmars-d
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
H. S. Teoh via Digitalmars-d
2014-10-07 18:20:43 UTC
Permalink
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
monarch_dodra via Digitalmars-d
2014-10-07 19:35:54 UTC
Permalink
Post by Dicebot via Digitalmars-d
Post by Jonathan via Digitalmars-d
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...

Continue reading on narkive:
Loading...