Two feature requests

Boris Kolar boris.kolar at globera.com
Sun Oct 22 14:31:03 PDT 2006


Two features will make this already great language even better:

1. Explicit interface implementation
  interface IFoo {
    void bar();
  }
  class Foo: IFoo {
    ...
    override void IFoo.bar() {
      ...
    }
  }

2. Make auto classes useful and allow them to be returned from functions,
passed to other functions, or be fields in other auto classes. Current
restrictions make them useless. I think auto class should behave like object
on stack, except default constructor (this() {...}) should be called it's
declared and destructor when it goes out of scope. The object itself may
reside on stack or heap, it doesn't really matter as long as stack semantics
applies. Also, I would remove requirement that auto class variables must be
explicitly declared "auto", so the following should be allowed:

auto class Foo { ... }
...
Foo x; // equivalent to "auto Foo x;"?

... or perhaps this:
Foo x; // equivalent to "auto Foo x = new Foo();"



More information about the Digitalmars-d mailing list