2017-09-29

(sph lang config)

a scheme syntax configuration file format for associative data structures.

library description

* all elements are scheme expressions

* all elements are read as being quasiquoted

* unquote can be used to create dynamically calculated results

* hashtables (eventually nested) are the parsing result

the file content or string is parsed with scheme read elements of a quasiquoted list.

in that list and sub-lists, expressions stand for key and value alternatingly.

lists and sub-lists become hashtables, with the following exception:

sub-lists that begin with a double period are returned as lists with the double period removed

# example file content

  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)

import name

(sph lang config)

exports

config-read

procedure

signature

port [eval-environment] ->

config-read-file

procedure

signature

a b ... ->

config-read-string

procedure

signature

a b ... ->

config-write

procedure

signature

a port ->

description

experimental


tags: guile documentation library scheme sph-lib computer sph-lang-config