EDN is a data format from the Clojure ecosystem. It is essentially the format of Clojure programs, minus surface syntax such as quoting, syntax-quoting, and @ rest argument syntax. This reader depends on the (chibi parse) module, part of Chibi Scheme but theoretically portable to any R7RS Scheme. This library, (edn), exports parse-edn and edn-value. Parse-edn is procedure of one argument and parses the passed source, returning a data structure representing the passed EDN. If parsing fails, an error is raised. Edn-value is a parser combinator that can be called with call-with-parse or other similar procedures in the (chibi parse) library. Additionally, the library exports predicates, accessors, and constructors for types that don't have exact analogs in Scheme or where the analogs are not nearly-universally supported. Of particular note, the library returns EDN nil as the Scheme symbol nil. This implementation should parse any valid EDN document. Also, since Clojure programs may emit ratio values, they are parsed into Scheme ratios despite their absence from the EDN standard. Finally, note that parse-edn will return #f on failure, which is also the result of parsing the string "false". If this is a problem, use the call-with-parse procedure metioned above. A test suite is included in the `(edn-test)` library. To execute it, evaluate `(run-tests)`.

(parse-edn source)