Syntax extension usage ====================== The easiest way to use Sexplib syntax extension is via findlib. To compile sources which are using it invoke findlib passing "-syntax camlp4o" and providing the "sexplib.syntax" package. For example: /tmp$ cp /usr/share/doc/libsexplib-camlp4-dev/examples/conv_test.ml /tmp /tmp$ ocamlfind ocamlc -linkpkg -package sexplib.syntax -syntax camlp4o -o conv_test conv_test.ml Similarly, to try the syntax extension in the toplevel: $ ledit ocaml Objective Caml version 3.10.1 # #use "topfind";; - : unit = () Findlib has been successfully loaded. Additional directives: # #camlp4o;; /usr/lib/ocaml/3.10.1/camlp4: added to search path /usr/lib/ocaml/3.10.1/camlp4/camlp4o.cma: loaded Camlp4 Parsing version 3.10.1 # #require "sexplib.syntax";; /usr/local/lib/ocaml/3.10.1/type-conv/pa_type_conv.cmo: loaded /usr/lib/ocaml/3.10.1/sexplib/pa_sexp_conv.cmo: loaded # type foo = Foo with sexp;; type foo = Foo val foo_of_sexp__ : Sexplib.Sexp.t -> foo = val foo_of_sexp : Sexplib.Sexp.t -> foo = val sexp_of_foo : foo -> Sexplib.Sexp.t = OCaml 3.10 ========== The only series of Sexplib supported in Debian is that for OCaml 3.10 or above, and the matching new CamlP4. If you want a Sexplib for OCaml << 3.10 you will need to compile it by yourself; old tarballs are available at http://www.ocaml.info/home/ocaml_sources.html . -- Stefano Zacchiroli Sat, 03 May 2008 14:59:47 +0200