I’m trying to use haxe to compile to Ocaml, and then from Ocaml to native code. At present, I have implemented some compilation contents.
At the same time, I’m simulating some sys API, such as file. Of course, the project is only for learning to use. I also need to learn the content of Ocaml.
I’m trying to translate the construction of
new class() into Ocaml; Here I still use method access.
Later I’ll try how to access methods in objects.
Did you consider using OCaml classes? I don’t know how well they map to Haxe, but it would save you the trouble of reimplementing OO-semantics.
Yes, I’ll try.
At present, I temporarily use the access method to implement object-oriented content. The variable initialization value is now implemented.
And the method access of object is realized,
var process2 = new Process("haxelib -help"); var data2 = process2.readAllString(">>>><<<"); trace(process2.getProcess2().name);