Version française
Home     About     Download     Resources     Contact us    
Browse thread
extending a functional updater implicitly publicizes sub-updater method?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Marc Herbert <marc.herbert.1@m...>
Subject: extending a functional updater implicitly publicizes sub-updater method?
[This is a shameless repost of
  http://groups.google.com/groups?selm=d1coe3%242l%241%40wolfberry.srv.cs.cmu.edu
 Looks like comp.lang.ml is more comp.lang.sml than comp.lang.caml...]

I don't understand why my private subupdater is "made public implicitly"

Example inspired from
 http://caml.inria.fr/ocaml/htmlman/manual005.html#ss:functional-objects
This sample code is quite similar to extending the constructor of a
superclass.


class functional_point =
   object
     val x = 0
     method private forward = {< x = x + 1 >}
   end;;

class functional_color_point =
   object
     inherit functional_point as super
     val color = 0

     (* color_forward is made implicitly public ?!? *)
     method private color_forward = {< color = color + 1 >}

     method private forward = super#forward#color_forward
   end;;


Same issue when "forward" method is not private.
I suspect there is some type issue here... could someone explain this?
Thanks in advance.