How to utop to print out really large lists.
"Douglas Lewit [email protected] [ocaml_beginners]" <[email protected]> Fri, 5 Feb 2016 12:02:49 -0600
| Newsgroups | gmane.comp.lang.ocaml.beginners |
|---|---|
| Message-ID | <CAM0XMJQK0b+w3M14GxWBg5cfgCGuyT1wwuh5K8TomihxJ0JL_A@mail.gmail.com> |
Hi everyone, So let's say that I'm using the following function to create a list of random integers: *let rec randomList lower upper size = if size = 0 then [ ] else ( lower + Random.int ( upper - lower + 1 )* *:: ( randomList lower upper ( size - 1 ) ) ;;* The function works great! I end up with a list of length size having random integers in the range lower..upper ( including the endpoints of that range ). But here's the catch. Let's say that I do this: *let dougsList = randomList 1 1000 1000 ;;* Okay, great.... but if I'm using the *utop interface* for OCaml, then I can only see about the first 350 ( approximately ) elements of my random list. Is there some setting in utop that I can change so that utop is forced to print out the entire list for the sake of my visual inspection. I realize that visually inspecting a list of 1,000 elements sounds rather crazy and unrealistic, but the user of the interface should have that option. Thanks for helping me solve this problem. Best, Douglas Lewit