edn

EDN data reader/writer

  1. edn
    1. EDN
    2. Documentation
    3. Reading EDN
      1. tag-handlers
      2. read-edn
    4. Writing EDN
      1. write-edn
    5. About this egg
      1. Author
      2. Repository
      3. License
      4. Dependencies
      5. Colophon

EDN

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

Documentation

Reading EDN

tag-handlers

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

An a-list parameter 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)`.

(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

Repository

https:///gitea.lyrion.ch/Chicken/edn

License

BSD

Dependencies

Colophon

Documented by chalk.