From 59598f42c16cf12e544e5bf2ce9c873fba94238e Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 6 Sep 2023 22:45:45 -0500 Subject: A newerer beginning --- lib/util.sld | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 lib/util.sld (limited to 'lib/util.sld') diff --git a/lib/util.sld b/lib/util.sld deleted file mode 100644 index 64c633e..0000000 --- a/lib/util.sld +++ /dev/null @@ -1,50 +0,0 @@ -;;; (boudin util) --- utility functions - -(define-library (boudin util) - (import (scheme base) - (scheme case-lambda) - (scheme eval)) - - (export identity - o - assoc-ref - slurp - eval/q) - - (begin - (define (identity x) x) - - (define (o . procs) ; stole from chicken core - (if (null? procs) - identity - (let loop ((procs procs)) - (let ((h (car procs)) - (t (cdr procs))) - (if (null? t) - h - (lambda (x) (h ((loop t) x)))))))) - - (define assoc-ref - (case-lambda - ((key alist) - (assoc-ref alist - key - (lambda () (error "Unrecognized key." key)))) - ((key alist failure) - (cond ((assoc key alist) => cdr) - (else (failure)))))) - - (define slurp - (case-lambda - (() (slurp (current-input-port))) - ((port) - (let loop ((ch (read-char)) - (acc '())) - (if (eof-object? ch) - (list->string (reverse acc)) - (loop (read-char) (cons ch acc))))))) - - (define (eval/q form env) ; this is probably a bad idea - (eval (list 'quasiquote form) env)) - - )) -- cgit 1.4.1-21-gabe81