I have created a list that contains a lot of elements in ocaml
and I want to see whats inside it, but ocaml
is only showing me a small part of it like this: [e1,e2,e3;...]
. How can I configure ocaml
to show everything?
Asked
Active
Viewed 191 times
3
1 Answers
7
You can see longer and deeper structures, interactively, with #print_length
and #print_depth
# #print_depth 0;;
# [1;2;3;4];;
- : int list = [...]
# #print_depth 1;;
# [[1];[2];[3];[4]];;
- : int list list = [[...]; [...]; [...]; [...]]
# #print_length 3;;
# [1;2;3;4];;
- : int list = [1; 2; ...]

Julian Fondren
- 5,459
- 17
- 29
-
Thank u for your answer so if my lost contain 1000 element and i dont printdepth 1000 it will show everthing ? – ZoCode Jan 01 '18 at 01:47
-
if you *don't* set a `#print_depth` then you'll live with whatever the default is. For a flat list, containing a thousand elements, you should set `#print_length` to a value greater than 1000. – Julian Fondren Jan 01 '18 at 01:49
-
I dont get how , i wrot it and its saying unbound value of print_length – ZoCode Jan 01 '18 at 01:56