Very very short question on objects

From: William Chesters (williamc@dai.ed.ac.uk)
Date: Mon Oct 25 1999 - 21:31:55 MET DST


Date: Mon, 25 Oct 1999 20:31:55 +0100
Message-Id: <199910251931.UAA11747@toy.william.bogus>
From: William Chesters <williamc@dai.ed.ac.uk>
To: caml-list@inria.fr
Subject: Very very short question on objects
In-Reply-To: <19991025114616.B226@jones.int-evry.fr>

Christian RINDERKNECHT writes:
> Method [f] is not private... Shouldn't be this an error?

It's deliberate: from node3.html#ss:private-methods in the html docs:

    Private methods can be made public in a subclass. [...] One
    could think that a private method should remain private in a
    subclass. However, it since the method is visible in a subclass,
    it is always possible pick it's code and define a method of the
    same name that run that code, [...]

In other words, ocaml's `private' is more like Java's `protected', and
afair Java's behaviour here agrees with ocaml's.



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:27 MET