On Saturday, 22 February 2014 at 02:52:37 UTC, Jesse Phillips wrote:
On Saturday, 22 February 2014 at 01:39:28 UTC, deadalnix wrote:
On Saturday, 22 February 2014 at 01:36:48 UTC, Walter Bright wrote:
On 2/21/2014 5:27 PM, deadalnix wrote:
That makes me sad that D has Java's object model rather than let's say, scala's
(which work with traits/interfaces).

D's object model works with interfaces.

I'm talking about this:
http://joelabrahamsson.com/learning-scala-part-seven-traits/

https://gist.github.com/JesseKPhillips/9147869

Two notes,

Creating an array required casting the first item to the common type.

D doesn't let you creating a new object and implement an interface. It seems that std.typecons is getting tripped up on the final method fly() so it can't be used either.

This code works fine:
http://dpaste.dzfl.pl/c0b3a941d917

Reply via email to