I'm new to OCaml, and I'm trying to follow 4.3 of this tutorial for defining custom quotation behavior. From what I've read, it seems that loading camlp4o.cma
is what makes the Quotation module visible to OCaml. So I tried the following in the OCaml interpreter:
# #load "dynlink.cma";;
# #load "camlp4o.cma";;
Camlp4 Parsing version 4.02.3
It looks like camlp4o.cma
was loaded successfully. So I continued with the rest of the tutorial:
# let expand _ s =
match s with
"PI" -> "3.14159"
| "goban" -> "19*19"
| "chess" -> "8*8"
| "ZERO" -> "0"
| "ONE" -> "1"
| _ -> "\"" ^ s ^ "\""
;;
val expand : 'a -> string -> string = <fun>
# Quotation.add "foo" (Quotation.ExStr expand);;
Characters 0-13:
Quotation.add "foo" (Quotation.ExStr expand);;
^^^^^^^^^^^^^
Error: Unbound module Quotation
I'm not sure why I'm getting this error. Did I skip something? I'm using OCaml version 4.02.3 on Windows, if that's relevant.