Skip to content

Instantly share code, notes, and snippets.

@alavrik
alavrik / t.piqi
Created December 16, 2012 06:58
Piqi definitions of OCaml's `type example = ConsOne of int array | ConsTwo of float array` `t_piqi.ml` generated from `t.piqi` by running `piqic ocaml --pp t.piqi`
.variant [
.name example
.option [
.name ConsOne
.type int-array
.ocaml-name "ConsOne"
]
.option [
@alavrik
alavrik / diff -u riakclient.proto.piqi riakclient.proto.piqi.edited
Created February 9, 2012 03:04
Compiling riakclient.proto for OCaml using Piqi
$ diff -u riakclient.proto.piqi riakclient.proto.piqi.edited
--- riakclient.proto.piqi 2012-02-08 20:55:35.000000000 -0600
+++ riakclient.proto.piqi.edited 2012-02-08 20:55:25.000000000 -0600
@@ -299,6 +299,7 @@
]
.field [
.name done
+ .ocaml-name "ocaml_done"
.type bool
.optional
@alavrik
alavrik / Makefile
Created August 17, 2011 04:28
Piq as a configuration file format
# this build relies on OCamlMakefile build script, it can be found here:
#
# http://www.ocaml.info/home/ocaml_sources.html#ocaml-make
#
RESULT = config
SOURCES = \
$(PIQI_ML_FILES) \
config.ml