[erlang-questions] Records / Proplists / JSON / BSON

Richard A. O'Keefe ok@REDACTED
Sun Jun 16 23:48:21 CEST 2013


On 15/06/2013, at 12:34 AM, Thomas Allen wrote:

> That makes sense. My only hesitation there is that I might eventually
> need the ability to embed more information than type specifications
> allow me to: Leaning on type specs feels like a dead end.
> 

There's another approach.

Define your own "record" language,
and generate the Erlang code (*including* -record declarations) from that.

Your "language" could just a data structure like
 {record, foo, [
   {Field,Type,...},
   ...
 }.
which could be enriched with whatever hints you want for JSON, BSON,
or whatever else takes your fancy.





More information about the erlang-questions mailing list