class base (x, y) = object (self) val mutable _x = x val mutable _y = y method print = print_int (x + y) end;; class derived x = let f x = (x + 1, x * 2) in object inherit base (f x) end;; let a = new derived 1;; a#print;;