racket/collects/honu/examples/old/subclass-ext.honu
Stevie Strickland 7dbb99d3c6 merged 292:296 from branches/sstrickl
svn: r297
2005-07-02 04:03:02 +00:00

31 lines
387 B
Plaintext

type t1 {
int x;
int y;
}
type t2 <: t1 {
int add();
}
class c1() : t1 implements t1 {
init int x;
init int y;
export t1 : x, y;
}
subclass c2() : t2 extends c1 at t1 implements t2 with int x, int y {
init int x;
init int y;
super(x = x, y = y);
int add() { return x + y; }
export t2: x, y, add;
}
int main() {
new c2:t2(x = 4, y = 6).add();
}