From 423ac382f9e73bf1ca7fc6b400f98db087cd7d22 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 Jun 2024 09:21:25 -0500 Subject: Write executable This involved moving `src' to `lib' and making `bin'. `bin' holds the program, which only imports `jimmy.main' from lib. --- src/util.scm | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/util.scm (limited to 'src/util.scm') diff --git a/src/util.scm b/src/util.scm deleted file mode 100644 index c71c600..0000000 --- a/src/util.scm +++ /dev/null @@ -1,49 +0,0 @@ -(module (jimmy util) * - - (import scheme (chicken base) - (chicken condition) - (only (chicken irregex) irregex-replace/all) - (chicken string)) - - (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-syntax ignore-errors - (syntax-rules () - ((ignore-errors x) - (handle-exceptions e #f x)))) - - (define (alist-walk lis . keys) - (if (null? keys) - lis - (let ((kv (assoc (car keys) lis))) - (cond - ((not kv) #f) - ((atom? (cdr kv)) - (and (null? (cdr keys)) ; this shouldn't error... - (cdr kv))) - ((list? (cdr kv)) - (apply alist-walk (cdr kv) (cdr keys))))))) - - (define (string-join ss #!optional (sep " ")) - (string-intersperse ss sep)) - - (define (flush-lines-left lines) - (irregex-replace/all '(: bol (* space)) - (string-join lines) "")) - - (define (join-lines lines) - (apply string-append lines)) - - ) - - -- cgit 1.4.1-21-gabe81