caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Ocaml and the Fragile Base Class Problem
@ 2011-08-27 10:53 Chris Yocum
  2011-08-27 11:24 ` Jacques Garrigue
  2011-08-27 15:06 ` Gerd Stolpmann
  0 siblings, 2 replies; 18+ messages in thread
From: Chris Yocum @ 2011-08-27 10:53 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

Hello,

A friend of mine is giving a talk about "monkey patching" entitled
"Monkey patching, subclassing, and accidental overriding"
(http://aaroncrane.co.uk/talks/monkey_patching_subclassing/paper.html).
 I was wondering how Ocaml deals with this situation or if it is even a
problem at all in Ocaml?  I mocked up some code:

class base =
object
  method meth x =
    print_endline "base";
    print_endline (string_of_int x)
end

class deriv =
object
  inherit base
  method meth x =
    print_endline "deriv";
    print_endline (string_of_int x)
end

which kind of(?) shows the problem in Ocaml.  He suggests in his paper
that using a Meta-Object Protocol is the way around this.  What do you
think?

Thanks,
Chris Yocum


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]

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

end of thread, other threads:[~2011-08-31 23:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-27 10:53 [Caml-list] Ocaml and the Fragile Base Class Problem Chris Yocum
2011-08-27 11:24 ` Jacques Garrigue
2011-08-27 15:06 ` Gerd Stolpmann
2011-08-27 16:59   ` David Baelde
2011-08-27 19:37     ` Gerd Stolpmann
2011-08-27 20:21       ` Jeff Meister
2011-08-27 23:08         ` Gerd Stolpmann
2011-08-28  9:31           ` Andreas Rossberg
2011-08-28 10:04             ` Guillaume Yziquel
2011-08-28 10:11             ` Gerd Stolpmann
2011-08-28 10:50               ` Andreas Rossberg
2011-08-29  3:35           ` Jacques Garrigue
2011-08-29 11:19             ` Chris Yocum
2011-08-29 11:47               ` Guillaume Yziquel
2011-08-29 12:03                 ` Chris Yocum
2011-08-31 21:33             ` Alain Frisch
2011-08-31 23:39               ` Jacques Garrigue
2011-08-28 17:58       ` Julien Signoles

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