aboutsummaryrefslogtreecommitdiff
path: root/module/parameters.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-04-23 18:46:09 +0200
committerHugo Hörnquist <hugo@hornquist.se>2019-04-23 18:46:09 +0200
commitef901153404d24ca1694a2b98e845eaca47aa085 (patch)
treeb6951abaacb63226819235c08a2b596795dc62d3 /module/parameters.scm
parentFix failing test. (diff)
downloadcalp-ef901153404d24ca1694a2b98e845eaca47aa085.tar.gz
calp-ef901153404d24ca1694a2b98e845eaca47aa085.tar.xz
Change how util is loaded.
Diffstat (limited to '')
-rw-r--r--module/parameters.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/module/parameters.scm b/module/parameters.scm
new file mode 100644
index 00000000..45b8862b
--- /dev/null
+++ b/module/parameters.scm
@@ -0,0 +1,23 @@
+;;; Commentary:
+
+;; This file should define all global configurable variables which
+;; doesn't belong anywhere else. The config module should then import
+;; this module, and set all configs as needed. The config module
+;; should also be able to set configs gotten from other parts.
+
+;;; Code:
+
+(define-module (parameters))
+
+(define (ensure pred?)
+ (lambda (v)
+ (unless (pred? v)
+ (error "Bad value to config"))
+ v))
+
+(define-public calendar-files
+ (make-parameter
+ '() (ensure list?)))
+
+(define-public summary-filter
+ (make-parameter (lambda (_ a) a) (ensure procedure?)))