Whilst one admirable aspiration of D is to make for better
meta-programming capability in a PL, IMHO one seemingly-lacking
aspiration of D is in the area of improving OO inheritance models
over and above that provisioned for in C++ and Java.
Maybe I'm ill-informed though I'd say that D, C++ and J
Wed, 01 Sep 2010 23:16:15 +0930, Justin Johansson wrote:
> Whilst one admirable aspiration of D is to make for better
> meta-programming capability in a PL, IMHO one seemingly-lacking
> aspiration of D is in the area of improving OO inheritance models over
> and above that provisioned for in C++ a
On Wed, Sep 1, 2010 at 18:13, retard wrote:
>
> Have you taken a loot at Scala & traits already? It would be a great
> starting point.
>
Scala's traits are great! Implicits in Scala are quite interesting too.
Also, Haskell typeclasses
I wonder if D can have part of Scala traits functionality wi
On 2010-09-01 22:44, Philippe Sigaud wrote:
On Wed, Sep 1, 2010 at 18:13, retard wrote:
Have you taken a loot at Scala & traits already? It would be a great
starting point.
Scala's traits are great! Implicits in Scala are quite interesting too.
Also, Haskell typeclasses
I wonder if
You mean like this?:
module add_virtual_functions;
import std.stdio : writeln;
void main()
{
test();
}
mixin template Foo()
{
void func()
{
writeln("Foo.func()");
}
}
class Bar
{
void func()
{
writeln("Bar.func()");
}
}
class Code : Bar
{
mixin F
Disregard the module name declaration. The original example had the
template mixin create a virtual method, and then you can override it
in the inheriting class.
On Wed, Sep 1, 2010 at 11:39 PM, Andrej Mitrovic
wrote:
> You mean like this?:
> module add_virtual_functions;
>
> import std.stdio : w
Ah nevermind. I didn't realize you've said "overload".
On Wed, Sep 1, 2010 at 11:39 PM, Andrej Mitrovic
wrote:
> You mean like this?:
> module add_virtual_functions;
>
> import std.stdio : writeln;
>
> void main()
> {
> test();
> }
>
> mixin template Foo()
> {
> void func()
> {
>
Wed, 01 Sep 2010 23:30:08 +0200, Jacob Carlborg wrote:
> On 2010-09-01 22:44, Philippe Sigaud wrote:
>> On Wed, Sep 1, 2010 at 18:13, retard wrote:
>>
>>
>> Have you taken a loot at Scala & traits already? It would be a
>> great starting point.
>>
>>
>> Scala's traits are great! Implicits
On 9/1/10 16:56 CDT, retard wrote:
Wed, 01 Sep 2010 23:30:08 +0200, Jacob Carlborg wrote:
On 2010-09-01 22:44, Philippe Sigaud wrote:
On Wed, Sep 1, 2010 at 18:13, retard wrote:
Have you taken a loot at Scala& traits already? It would be a
great starting point.
Scala's traits a
On 2010-09-01 23:39, Andrej Mitrovic wrote:
You mean like this?:
module add_virtual_functions;
import std.stdio : writeln;
void main()
{
test();
}
mixin template Foo()
{
void func()
{
writeln("Foo.func()");
}
}
class Bar
{
void func()
{
writeln(
Yeah, my mistake. I missread your post. :)
But, you can use mixin expressions to add overloaded methods. E.g.:
import std.stdio;
class Bar
{
void func()
{
writeln("Bar.func()");
}
mixin("void func(string x) { writeln(x); }");
}
void main()
{
Bar bar = new Bar;
b
11 matches
Mail list logo