simple-configuration /

Filename Size Date modified Message
tests
29 B
45 B
1.3 KB
370 B
154 B
2.9 KB
251 B

Simple-Configuration

This is a small scheme library to hande configurations in a simple manner. It uses lists as the basic datastructure to hold configurations.

Examples:

(define my-config
 '((production
    (database
      (username "prod")
      (password "prodpwd")
      (host "test.example.com")))
   (development
    (database
      (username "dev")
      (password "devpwd")
      (host "dev.example.com")))
  (logging
   (destination "/var/log/application.log")
   (levels (error warning)))))

;; now you can access the data like so

(config-ref my-config '(production database username)) ;; => "prod"
(config-ref my-config '(production database))          ;; => (username "prod")
(config-ref my-config '(production database))   ;; => ((username "prod") (password "prodpwd") (host "test.example.com"))

(config-let my-config ((db-user (production database username))
                       (db-pw   (production database password))
                       (db-host (production database host)))
  (connect-to-database db-host db-user db-pw))

;; postprocess data
(config-ref my-config '(logging levels) post-process: (lambda (ls) (cons 'critical ls))) ;; => (critical error warning)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.