From: Marc Herbert <marc.herbert.1@ml.free.fr>
To: caml-list@yquem.inria.fr
Subject: extending a functional updater implicitly publicizes sub-updater method?
Date: Tue, 22 Mar 2005 20:18:06 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.58.0503222012210.3222@fcat> (raw)
[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.
next reply other threads:[~2005-03-22 19:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-22 19:18 Marc Herbert [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0503222012210.3222@fcat \
--to=marc.herbert.1@ml.free.fr \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox