D idioms list

ketmar via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Thu Jan 8 21:58:00 PST 2015


On Thu, 08 Jan 2015 21:22:30 +0000
ponce via Digitalmars-d-announce <digitalmars-d-announce at puremagic.com>
wrote:

> On Thursday, 8 January 2015 at 20:23:11 UTC, ketmar via 
> Digitalmars-d-announce wrote:
> > i'm not sure, but maybe it worth renaming "struct inheritance" 
> > to
> > "extending a struct"? or even something completely different. 
> > what it
> > does is actually extending/augmenting the struct, but not
> > OO-inheritance, as one cannot pass "augmented" struct to the 
> > function
> > which expects original struct. at least without hackery.
> 
> Renamed, thanks!
p.p.s. maybe it's worth adding Artur's code sample[1] too, to show that
"extended" structure can be passed to functions which requires original
one? it's not obvious, at least for me. ;-)

[1] http://forum.dlang.org/post/mailman.4332.1420752329.9932.digitalmars-d-announce@puremagic.com
-------------- 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-announce/attachments/20150109/b0197f2b/attachment.sig>


More information about the Digitalmars-d-announce mailing list