chickadee » edn

edn.egg

EDN data reader/writer

EDN

This egg provides a parser and a writer for the Extensible Data Notation.

Documentation

Reading EDN

tag-handlers

tag-handlersconstant

An a-list containing the handlers for reader tags. You can register your own reader tags by simply adding a new a-list entry.

Example for a tag "#keywordify": add the entry `(cons keywordify: keywordify-procedure)`.

(define tag-handlers (list (cons _: (lambda (input) edn/omit:))))

read-edn

read-ednprocedure

Reads EDN data from the `current-input-port`, converts it to Chicken data and returns it. Precision suffixes for numbers get ignored, maps get converted to SRFI-69 hashtables, vectors to SRFI-4 vectors.

(define (read-edn) (second ((parse-edn '()) (current-input-port))))

Writing EDN

write-edn

write-edn structprocedure

Converts Chicken data structures to EDN and writes it to the `current-output-port`.

struct
A Chicken data structure consisting of atoms, lists, vectors and hashtables.
(define (write-edn struct)
  (lambda () (display (parse-entry struct) (current-output-port))))

About this egg

Author

Daniel Ziltener

License

BSD

Dependencies

Colophon

Documented by hahn.

Contents »