O'Reilly logo

Clojure Applied by Alex Miller, Ben Vandgrift

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Extensible Data Notation

The edn format is a text-serialization format often used with Clojure. Programs written in the Clojure language are represented in a superset of the edn format. Given its close wiring into the language, edn is an easy choice for reading and writing data. Although edn is most commonly seen in the Clojure community, implementations are available in other languages.[24]

Representing a product catalog in edn would take the following form:

 
[{:num 112
 
:dept :clothing
 
:desc ​"V-Neck T-Shirt"
 
:item-attributes {
 
:sizing {:type :general :size :large}
 
:color :blue
 
:manufacturer-id 11250
 
:categories #{:mens :shirts :undershirts :vneck :premium}}
 
:price #pricing/money ​"$55.35"​}
 
{:num 113
 
:dept :clothing

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required