From 8179c0025a44a769ab6ad2e5c0a58f545517280c Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 17 Jan 2024 00:24:11 -0600 Subject: Change organization and massively refactor --- lib/util.sld | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 lib/util.sld (limited to 'lib/util.sld') 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 @@ +(module (acdwm util) ( + define-public + ignore + DEBUG + dprint + ) + + (import scheme (chicken base) + (chicken port)) + + (define-syntax define-public + (syntax-rules () + ((define-public (name . arg) forms ...) + (begin (export name) + (define (name . arg) forms ...))) + ((define-public (name args ...) forms ...) + (begin (export name) + (define (name args ...) forms ...))) + ((define-public name value) + (begin (export name) + (define name value))))) + + (define (ignore . _) #f) + + (define (eprint . xs) + (with-output-to-port (current-error-port) + (lambda () (apply print xs)))) + + (define DEBUG (make-parameter #f)) + + (define (dprint . xs) + (when (DEBUG) + (apply eprint xs)))) -- cgit 1.4.1-21-gabe81