λambder on software

This is my journey into the world of computer science and geekery.

JSONERL is published. It is simple tool for turning your erlang records into json and back. Here is an example of the usage of jsonerl:

-include("jsonerl.hrl").
-record(artist, {name, year_of_birth, city, photo, movies}).
 
Artist = #artist{name = <<"Luc Besson">>, year_of_birth = 1959, city = <<"Paris">>, photo = <<"http://is.gd/3pYJF">>, movies = [<<"Taken">>,<<"Bandidas">>,<<"Taxi">>]},
Json = ?record_to_json(artist, Artist),
Artist = ?json_to_record(artist, Json).

the resulting json will be:

{
     name: "Luc Besson",
     year_of_birth: 1959,
     city: "Paris",
     photo: "http://is.gd/3pYJF",
     movies: ["Taken","Bandidas","Taxi"]
}

The code is available at github.

.

2 years ago