matthusby/erlang_destructure_json
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the built version of the erlang file from (http://www.progski.net/blog/2010/destructuring_json_in_erlang_made_easy.html) USAGE: <pre> 1> Obj = mochijson2:decode("{ \"post\": { \"title\": \"Destructuring JSON in Erlang Made Easy\" }}"). {struct,[{<<"post">>, {struct,[{<<"title">>, <<"Destructuring JSON in Erlang Made Easy">>}]}}]} 2> json:destructure("Obj.post.title", Obj). <<"Destructuring JSON in Erlang Made Easy">> 3> Obj2 = mochijson2:decode("{ \"person\": { \"name\": \"ryan\", \"friends\": [ \"Brendan\", \"Smokey\", \"Bams\" ] }}"). {struct,[{<<"person">>, {struct,[{<<"name">>,<<"ryan">>}, {<<"friends">>,[<<"Brendan">>,<<"Smokey">>,<<"Bams">>]}]}}]} 4> json:destructure("Obj.person.friends[1]", Obj2). <<"Smokey">> </pre>
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published