caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* extending a functional updater implicitly publicizes sub-updater method?
@ 2005-03-22 19:18 Marc Herbert
  2005-03-22 19:56 ` [Caml-list] " Remi Vanicat
  0 siblings, 1 reply; 7+ messages in thread
From: Marc Herbert @ 2005-03-22 19:18 UTC (permalink / raw)
  To: caml-list

[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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-03-31  2:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-22 19:18 extending a functional updater implicitly publicizes sub-updater method? Marc Herbert
2005-03-22 19:56 ` [Caml-list] " Remi Vanicat
2005-03-22 23:34   ` wish for something like 'restricted' methods james woodyatt
2005-03-23  5:03     ` [Caml-list] " Jacques Garrigue
2005-03-23  8:22       ` james woodyatt
2005-03-30 13:16   ` private methods restricted to self? Marc Herbert
2005-03-31  2:30     ` [Caml-list] " Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).