Is there a way to construct lists in OCaml without using the :: operator?
For example, I know that normally elements would be concatenated as follows:
1::[2; 3; 4]
which produces [1; 2; 3; 4].
What I'm wondering is if it's possible to implement a method that takes
cons(1 cons(2 cons(3 cons (4 nil))))
and outputs the same result, as shown in the cons Wikipedia page.
Thank you.