some small example using s-expressions
Francois Berenger
francois.berenger.working at gmail.com
Thu Nov 22 00:24:00 GMT 2012
Thanks for all the answers!
It helps a lot, really,
My use case will be to have some kind of property file for my project
(as in the Java world) by using s-expressions.
On Thu, Nov 22, 2012 at 12:24 AM, Ashish Agarwal <agarwal1975 at gmail.com> wrote:
> In _oasis, add sexplib.syntax to BuildDepends.
>
> Make your _tags file like this:
>
> $ cat _tags
> # OASIS_START
> # OASIS_STOP
>
> <.ml{,i}>: syntax_camlp4o
>
> Then, create some type defs:
>
> $ cat a.ml
> type t = A | B of int
> with sexp
>
> 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.
>
> On Wed, Nov 21, 2012 at 3:00 AM, Francois Berenger
> <francois.berenger.working at gmail.com> wrote:
>>
>> Hello,
>>
>> I am looking for some introduction to using s-expressions.
>>
>> A small and simple example would be enough
>> for me to get started:
>>
>> I'd like to know:
>> - what to change in my code to enable them (just add ' with sexp' after
>> some type declaration?)
>> - what to change in my build system to enable them (I use oasis)
>>
>> Thanks a lot,
>> Francois.
>>
>
More information about the core
mailing list