You are looking at historical revision 45293 of this page. It may differ significantly from its current revision.
libyaml
Read or dump yaml.
Repository is in:
Note that this page may be out of date. The latest exact document should be deployed as part of the repository:
Read the documents in the repository for futher help.
Requirememnts
Simple examples
Reading yaml
Use yaml<- procedure for reading yaml.
(yaml<- "--- 1\n--- 2\n...") ;will return a procedure ((yaml<- "--- 1\n--- 2\n...")) ;will return 1 ((yaml<- "--- 1\n--- 2\n...") 0) ;will return 1 ((yaml<- "--- 1\n--- 2\n...") 1) ;will return 2 ((yaml<- "--- 1\n--- 2\n...") -1) ;will return '(1 2) ((yaml<- "--- 1\n--- 2\n...") 2) ;will abort by exception (yaml<-) ;will try to read yaml from (current-input-port) and return a procedure
For more element, such as yaml-list, yaml-mapping, refer to:
- https://codeberg.org/rikuri/libyaml.ss/src/branch/main/docs/usage.md#yaml-and-scheme
- https://codeberg.org/rikuri/libyaml.ss/media/branch/main/docs/yns/yns.svg
Dumping yaml
Use <-yaml procedure for dumping yaml.
(<-yaml #:strict-input (yaml<- "[1]")) (<-yaml ((yaml<- "[1]"))) (<-yaml #("1st" ())) (<-yaml `(#:port . ,(current-output-port)) ((yaml<- "---\n---\n---\n[1,2,3]") 2))