Virtual extension methods -- second draft

Howard Lovatt howard.lovatt at gmail.com
Tue Jul 13 00:33:19 PDT 2010


@Andrew,

I would write the code like you jokingly suggest, OK I wouldn't use
AnnoyingAndPoinlessInnerClass for the name I would use Trait, because
I like to have the definition and the declaration in the same file.
One of the annoying things in C++ is having to have headers and
bodies.

Cheers,

 -- Howard.

On 13 July 2010 10:38, Andrew Thompson <lordpixel at mac.com> wrote:
>
> On Jun 11, 2010, at 8:07 PM, Howard Lovatt wrote:
>
>> I don't think that it would confuse people and would probably become the
>> norm, instead of abstract classes (which would be a good thing since it
>> would eliminate state). With the current proposal you have to make an
>> interface and a class of static methods, for *most* use cases this is
>> verbose and a pain since you separate the implementation from the
>> declaration.
>
>
> Yes. I agree with Howard Please don't make me open another file to find the implementation. If you do that to me, I'm going to be horribly tempted to write this
>
> public interface Foo {
>    public void method();
>    public extension void method2() default AnnoyingAndPoinlessInnerClass.method2();
>
>   public static final class AnnoyingAndPoinlessInnerClass {
>        public void method2() {
>                 ...
>        }
>    }
> }
>
> Which certainly isn't better than:
>
> public interface Foo {
>    public void method();
>    public extension void method2() default {
>                 ...
>    }
> }
>
> At least I've avoided 2 files, but no one could love the first example.
>
> AndyT (lordpixel - the cat who walks through walls)
> A little bigger on the inside
>
>        (see you later space cowboy, you can't take the sky from me)
>
>
>



-- 
  -- Howard.


More information about the lambda-dev mailing list