You are looking at historical revision 32746 of this page. It may differ significantly from its current revision.

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

[constant] tag-handlers → (list (cons _: (lambda (input) edn/omit:)))

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

[procedure] (read-edn) → unspecified

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

[procedure] (write-edn struct) → unspecified

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.