News for hackers. Stuff that matters.
Re:Goodbye, shitty Car extends Vehicle object-orientation tu... by colllectorof on Sunday October 20, 2019 @05:35PM (#21307316)
OCaml has real objects and classes. Moreover, it is trivial to demonstrate that your example doesn't work in practice:

  module Foo = struct
   let first() = 1
   let second() = first() + 1
  end

  module Bar = struct
    include Foo
    let first() = 0
  end
Bar.second () will still be 2 because of static binding. Thus you cannot use this approach to replace 'first' by itself without creating inconsistencies.

There are no comments on this comment yet.