Outdated egg!

This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for the CHICKEN 5 version of this egg, if it exists.

If it does not exist, there may be equivalent functionality provided by another egg; have a look at the egg index. Otherwise, please consider porting this egg to the current version of CHICKEN.

edn.egg

EDN data reader/writer

  1. Outdated egg!
  2. edn.egg
    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. License
      3. Dependencies
      4. Colophon

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.