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: signature.asc
Description: OpenPGP digital signature

Reply via email to