diff options
author | Case Duckworth | 2024-01-17 00:24:11 -0600 |
---|---|---|
committer | Case Duckworth | 2024-01-17 00:24:11 -0600 |
commit | 8179c0025a44a769ab6ad2e5c0a58f545517280c (patch) | |
tree | 8de19b673bbddbfcbb03c7d2363ca937ccf4aa3b /lib/util.sld | |
parent | Update .gitignore (diff) | |
download | acdwm-8179c0025a44a769ab6ad2e5c0a58f545517280c.tar.gz acdwm-8179c0025a44a769ab6ad2e5c0a58f545517280c.zip |
Change organization and massively refactor v001
Diffstat (limited to 'lib/util.sld')
-rw-r--r-- | lib/util.sld | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/util.sld b/lib/util.sld new file mode 100644 index 0000000..fc6a24b --- /dev/null +++ b/lib/util.sld | |||
@@ -0,0 +1,33 @@ | |||
1 | (module (acdwm util) ( | ||
2 | define-public | ||
3 | ignore | ||
4 | DEBUG | ||
5 | dprint | ||
6 | ) | ||
7 | |||
8 | (import scheme (chicken base) | ||
9 | (chicken port)) | ||
10 | |||
11 | (define-syntax define-public | ||
12 | (syntax-rules () | ||
13 | ((define-public (name . arg) forms ...) | ||
14 | (begin (export name) | ||
15 | (define (name . arg) forms ...))) | ||
16 | ((define-public (name args ...) forms ...) | ||
17 | (begin (export name) | ||
18 | (define (name args ...) forms ...))) | ||
19 | ((define-public name value) | ||
20 | (begin (export name) | ||
21 | (define name value))))) | ||
22 | |||
23 | (define (ignore . _) #f) | ||
24 | |||
25 | (define (eprint . xs) | ||
26 | (with-output-to-port (current-error-port) | ||
27 | (lambda () (apply print xs)))) | ||
28 | |||
29 | (define DEBUG (make-parameter #f)) | ||
30 | |||
31 | (define (dprint . xs) | ||
32 | (when (DEBUG) | ||
33 | (apply eprint xs)))) | ||