Walter's second axiom

Janice Caron caron800 at googlemail.com
Sat Dec 8 04:54:56 PST 2007


On 12/8/07, Janice Caron <caron800 at googlemail.com> wrote:
> As discussed elsewhere, Walter's second axiom states: for any type T,
> it should be possible to construct a struct S which behaves exactly
> like a T

I would like to see this axiom turned into a language feature, so that
one could write

    struct S : T {}

to create a struct S which behaves exactly like a T. For example

    struct MyInt : int
    {
        /* extra functions */
    }

which would be equivalent to

    struct MyInt
    {
        int n;
        /* forwarding functions */
        /* extra functions */
    }

That would just be so cool.



More information about the Digitalmars-d mailing list