Open robertblackwell opened 2 years ago
Yeah, this is a general problem in the book. There are installation instructions that tell you what you need to do (linked to from the guided tour and from the prologue:
http://dev.realworldocaml.org/install.html
but the document is a little long, and it's easy to miss the right invocation:
#use "topfind";;
#thread;;
#require "core.top";;
And the "open Core" is at the top of the chapter, as it is at the top of nearly every chapter. ("open Base" works too for what you did.)
I'm honestly not sure how to make this better. Open to suggestions.
This is by way of a bit of a whinge, though by publishing this info it might help some other poor newbie like me.
Its also a more general comment about what I have found to be an impediment and discouragement to learning Ocaml. Namely a lot of simple things are left un-said and they accumulate to be a real impediment.
I am working on the query handler given as an example in "Real World Ocaml" and got to the point of
to which I got the error message "Error: Unbound value int_of_sexp"
well a few hours, and much hair tearing, latter I had the following series of
utop
commandswhich gave :
Not at all what I expected nor what the book predicted. So more searching and eventually the additional command
gave the expected output.