On 7/23/11, Andrei Alexandrescu <seewebsiteforem...@erdani.org> wrote:
> Currently, in order for a program with separately-implemented methods to
> work properly, there must be TWO different files for the same class

Can we get a chat log of this discussion to figure out what is trying
to be solved here?

interface IFoo
{
    int foo();
}

class Foo : IFoo
{
    private int x;

    version(one)
    {
        int foo() { return x; }
    }
    else
    version(two)
    {
        int foo() { return x++; }
    }
}

$ dmd -c foo.d -version=one

or:

class Foo : IFoo
{
    mixin(import("FooImpl.d"));
}

$ dmd -c foo.d -J./my/foo/

There are probably other ways to do this within the existing framework.

My vote goes to Walter and other contributors to work on fixing
existing bugs so we can have not a perfect but a working language.

Reply via email to