Source

ocamlspot /

Filename Size Date modified Message
tests
tools
2.6 KB
47 B
170 B
77 B
3.3 KB
31.1 KB
4.3 KB
2.0 KB
921 B
4.1 KB
1.5 KB
1.6 KB
1010 B
2.3 KB
1.5 KB
1.3 KB
1.3 KB
1.1 KB
1.3 KB
1.3 KB
25.0 KB
12.5 KB
1.9 KB
4.0 KB
1.1 KB
52.9 KB
6.6 KB
6.1 KB
915 B
1.9 KB
17.3 KB
3.4 KB
11.2 KB
1.5 KB
2.6 KB
1.6 KB
25.8 KB
5.3 KB
1.0 KB
8.4 KB
1.3 KB
7.1 KB
4.0 KB
1.9 KB
1.1 KB
1.0 KB
933 B
7.6 KB
921 B
2.0 KB
1.1 KB
1.3 KB
1.2 KB
2.2 KB
1.2 KB

OCamlSpotter - OCaml source browsing

OCamlSpotter is a tool for OCaml source code browsing. You can search the type and definitions of values, expressions and modules.

OCamlSpotter 2.0.0 uses *.cmt and *.cmti files created by OCaml compiler 4.00.0 or newer with -bin-annot option.

Unlike OCamlSpotter 1.x, OCamlSpotter 2.0.0 is a standalone application. You NO LONGER need compiler patching. Just make, make install, and configure ocamlspot.el.

Dependency

OCamlSpotter strongly depends on OCaml compiler implementation and its compiler-libs library. You need use the correct pairs of compiler and OCamlSpotter.

https://bitbucket.org/camlspotter/ocamlspot provides OCamlSpotter branches for each OCaml versions:

  • ocaml-version-name : compilable against the given OCaml version
  • default : For the latest OCaml development version or something around. Probably not for you.
  • dev : default + something experimental. Absolutely not for you unless you are explicitly instructed to use this.

To work with OCamlSpotter

To browse modules correctly,

  • Compile them with -bin-annot ocaml compiler option.
  • Keep the source code and produced cmt/cmti files.
  • Install cmt/cmti files along with cmi/cma/cmxa files.

Otherwise OCamlSpotter complains that it cannot find required cmt/cmti files.

Normally this requires little modifications to the build script of each library:

  • Add -bin-annot to the compiler switch (for example OCAMLCFLAGS += -bin-annot)

  • Copy cmt and cmti files at installation. For example:

    install::
       cp \*.mli \*.cmi \*.cma \*.cmt \*.cmti \*.cmxa $(INSTALLDIR)
    

To facilitate this you may want to use SpotInstall( https://bitbucket.org/camlspotter/spotinstall ). SpotInstall provides:

  • No need to fix build scripts, since the compiler can produce annot/cmt/cmti files by default, if OCAML_ANNOT env var is non empty
  • Automatic cmt/cmti post installation