some small example using s-expressions
David House
dhouse at janestreet.com
Wed Nov 21 09:31:51 GMT 2012
I'm not sure about the build side, but the usage is very simple. You
do indeed just say "with sexp" on every type you want to be sexpable,
in both the .ml and .mli.
You will then have two new functions:
t_of_sexp : Sexp.t -> t
sexp_of_t : t -> Sexp.t
(Replace "t" with the name of your type throughout.)
You can use these with, e.g., Writer.write_sexp(s), Reader.load_sexp(s).
On Wed, Nov 21, 2012 at 8:31 AM, Malcolm Matalka <mmatalka at gmail.com> wrote:
> https://github.com/avsm/ocaml-tutorial/tree/master/examples/broker
>
> Francois Berenger <francois.berenger.working at gmail.com> writes:
>
>> 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