2021-02-05

(sph lang config)

a scheme syntax configuration file format that parses to a alist or hashtable, possibly nested.

part of sph-lib

library description

* all elements are scheme literals

* key and value are specified alternatingly

* keys are symbols

* indent of two spaces is used for nesting

* nesting is unlimited

example:

  default-type "text"

  mode development

  start-id #xa

  preview-image-size (unquote (+ 255 1))

  browse

    page-size 75

    include-types ("itml" "plaintext")

  other #(1 2 4)

module name

(sph lang config)

exported bindings

procedure: config-read port #:hashtable ->
port #:hashtable boolean -> list:((symbol:key . any:value) ...)
if hashtable is true, the result is a hashtable, possibly with nested hashtables
procedure: config-read-file a b ... ->
procedure: config-read-string a b ... ->
procedure: config-write a port ->
alist/hashtable port -> unspecified
write a config alist or hashtable to port.
one key/value pair per line and nested values indented after key