In _oasis, add sexplib.syntax to BuildDepends.<div><br></div><div>Make your _tags file like this:</div><div><div><br></div><div>$ cat _tags </div><div># OASIS_START</div><div># OASIS_STOP</div><div><br></div><div><.ml{,i}>: syntax_camlp4o</div>
<div><br></div><div>Then, create some type defs:</div><div><br></div><div>$ cat <a href="http://a.ml">a.ml</a></div><div>type t = A | B of int</div><div>with sexp</div><div><br></div><div>And similarly add "with sexp" in your .mli files if you want the sexp converters available in the interface. You'll get extra functions t_of_sexp and sexp_of_t. Biocaml does this, so you can see that code for an example.</div>
<br><div class="gmail_quote">On Wed, Nov 21, 2012 at 3:00 AM, Francois Berenger <span dir="ltr"><<a href="mailto:francois.berenger.working@gmail.com" target="_blank">francois.berenger.working@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br><br>I am looking for some introduction to using s-expressions.<br><br>A small and simple example would be enough<br>
for me to get started:<br><br>I'd like to know:<br>- what to change in my code to enable them (just add ' with sexp' after some type declaration?)<br>- what to change in my build system to enable them (I use oasis)<br>
<br>Thanks a lot,<br>Francois.<br><br></blockquote></div><br></div>