edn/README.md

53 lines
2.4 KiB
Markdown
Raw Normal View History

2020-02-19 00:44:30 +00:00
[![License](https://img.shields.io/badge/license-BSD-blue.svg?style=flat)]()
2020-02-19 00:51:48 +00:00
[![Chicken Scheme](https://img.shields.io/badge/Chicken-Scheme-ECC42F.svg?style=flat)](https://www.call-cc.org/)
[![Egg](https://img.shields.io/badge/Eggversion-0.5.2-blue.svg?style=flat)](https://wiki.call-cc.org/eggref/4/edn)
[![Gratipay](https://img.shields.io/liberapay/receives/zilti.svg?style=flat)](https://liberapay.com/zilti)
2020-02-19 00:44:30 +00:00
[![Flattr this](https://api.flattr.com/button/flattr-badge-small.png)](https://flattr.com/submit/auto?user_id=zilti&url=https%3A%2F%2Fbitbucket.org%2Fzilti%2Fedn)
2020-02-19 00:29:52 +00:00
chicken-edn
===========
2020-03-03 23:25:18 +00:00
An [EDN](https://github.com/edn-format/edn) reader and writer for R7RS compatible Schemes.
2020-02-19 00:29:52 +00:00
Installation: `chicken-install edn`
Data type conversions
---------------------
* All kinds of numbers get converted to Scheme numbers, precision suffixes (N and M) get ignored.
* Keywords :keyword get converted to chicken scheme keywords keyword:.
* Maps get converted to SRFI 69 hashtables.
* Vectors are srfi-4 vectors.
* true = #t, false = #f, nil = '()
Missing reader functionality
----------------------------
2020-03-03 23:25:18 +00:00
Should you notice missing functionality of the reader, plesase use [the issues page](https://gitea.lyrion.ch/zilti/edn/issues) to report
2020-02-19 00:29:52 +00:00
it and, if possible, provide a minimal test case.
API
---
2020-03-03 23:25:18 +00:00
* Transforming EDN into Scheme: `(read-edn <port>)`
* Transforming Scheme into EDN: `(write-edn <port> <datastructure>)`
2020-02-19 00:29:52 +00:00
* Using reader tags: the library contains a public a-list `tag-handlers`. To register a handler, add an a-list entry where the key is the tag without `\#` and as a keyword, and the value a one-argument procedure.
Releases
--------
2020-02-19 00:51:48 +00:00
* **0.5.2**: Update for Chicken 5
2020-02-19 00:29:52 +00:00
* **0.5.1**: Small compatibility improvements: "/" now starts a symbol as well, and "," is treated as whitespace.
* **0.5**: Reader tag support.
* **0.4**: Complete rewrite. Only relies on R7RS, and SRFI 1, 4, 69 and 88. Uses ports. Reads and writes EDN.
* **0.3**: EDN tags, including special forms, work. #inst and #uuid both get read as strings. Add nil. Add number prefixes. Add no-space-required to #_ tag.
* **0.2.1**: Can read EDN-files and -strings. EDN tags are not working yet.
* **0.2**: Can read EDN-strings with one top-level data structure.
Roadmap
-------
About
-----
Written by Daniel Ziltener. EDN written by Rich Hickey. The EDN specification is available at [https://github.com/edn-format/edn](https://github.com/edn-format/edn).