It is done. I now have an account on Github and my first open source repository has just been pushed. Feel free to take it for a spin. And don't forget to tell me what you think of it.
Anyway, after downloading and unpacking the library, just follow the installation instructions in the README file. If you have findlib installed, using the library is as simple as typing
> #use "topfind";;
> #require "inspect";;
into your OCaml prompt. I suggest you open the Inspect module as well.
> open Inspect;;
For starters, both the Dot and the Sexpr library provide a test_data function to generate some interesting data to dump.
> Sexpr.dump (Sexpr.test_data ());;
> Dot.dump (Dot.test_data ());;
It is naturally also possible to let the dump functions inspect themselves:
> Sexpr.dump Sexpr.dump;;
> Dot.dump Dot.dump;;
If you are on a Mac, the Inspect.Dot.dump_osx function should be of interest. It writes the DOT output to a temporary file, uses Graphviz to generate the graph, and displays the results using the open command.
> Dot.dump_osx Dot.dump_osx;;
It goes without saying that you should have Graphviz installed for this last part to work.
Have fun!
No comments:
Post a Comment