In a previous question asked I learned that a separate file is forcibly a module. This is of course true for a class definition in a file. I have a file point.ml with the class point, compiled, and are doing in the toplevel:
# #load "point.cmo";;
# let p = new point (1,1);;
Error: Unbound class point
# let p = new Point.point (1,1);;
val p : Point.point = <obj>
#
Is there a way to get rid of the outer module Point?
Accepted solution
I asked two times, and there seems to be no way around automatic module generation per file. So one has to adjust to it, and either open the module, or make best use of module and object name to turn this into a feature. There still are module aliases, and the module name of an object is quite irrelevant after instantiation.