Classes and objects are not well documented, because these functions greatly complicate (usually) very few advantages compared to the more idiomatic approach. But if you know the OCaml syntax for something, you can always see what the equivalent of Reason is when converting it with the Try Reason online platform. See your example here , which gives us the following:
class stack_of_ints = { as self; val mutable the_list: list int = []; pub push x => the_list = [x, ...the_list]; };
source share