Protoml + Camlp4
A little update to this morning's article, I wrote a little camlp4 extension which makes it easier to user the prototype module (and it doesn't overwrite the records).
let _ =
let p = {} in
p.foo <- "p.foo";
p.baz <- "p.baz";
let p = {} in
p.foo <- "p.foo";
p.baz <- "p.baz";
let o = {}|p| in
o.foo <- "o.foo";
o.bar <- (fun f -> f (o.baz));
print_endline (p.foo);
print_endline (p.baz);
print_endline (o.foo);
((o.bar) : 'a->'b) print_endline;