(text yaml) -- YAML parser

Library (text yaml)

This library provides YAML parser and writer.

Function yaml-read in

Reads YAML documents from the given textual input port in and returns a list of S-expression represented YAML documents.

The returning YAML documents are the compatible with vector JSON format described in (text json).

(yaml-read (open-string-input-port "
%YAML 1.2
---
foo: bar
boo:
- 1
- 2
- 3
- 4"))
'(#((foo . bar) (boo 1 2 3 4)))

Function yaml-write yaml
Function yaml-write yaml out

Writes the given list of S-expression represented YAML documents yaml to the out.

If the first form is used, then it writes to (current-output-port).

(yaml-write '(#(("foo" . "bar") ("boo" 1 2 3 4))))
;; Prints the following
#|
%YAML 1.2
---
foo: bar
boo:
- 1
- 2
- 3
- 4
...
|#