From 23280d6f118518c278acd06be2c7b8131ddecfbd Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Sun, 13 Aug 2023 00:37:00 -0600 Subject: [PATCH] wip! compat: Remove upstreamed shims. --- gash/compat.scm | 37 ++----------------------------------- 1 file changed, 2 insertions(+), 35 deletions(-) diff --git a/gash/compat.scm b/gash/compat.scm index bca76b0..5020f8b 100644 --- a/gash/compat.scm +++ b/gash/compat.scm @@ -89,7 +89,6 @@ string-for-each string-every string-any - the-eof-object noop make-prompt-tag call-with-prompt @@ -110,8 +109,7 @@ exact-integer? set-program-arguments open-file - tmpfile - sort) + tmpfile) (define-macro (define-inlinable . rest) `(define ,@rest)) @@ -166,8 +164,6 @@ #t (loop (+ k 1))))))) - (define the-eof-object (integer->char -1)) - (define (noop . args) #f) (define* (make-prompt-tag #:optional (stem "prompt")) @@ -305,33 +301,4 @@ (port (open name flags))) ;; Delete the file so that it's gone when we're done. (delete-file name) - port)) - - ;; A simple (slow!) sort procedure. It's needed for globbing. - (define (sort items less) - (define (split-reverse lst) - (let loop ((lst lst) (acc1 '()) (acc2 '())) - (cond - ((null? lst) (values acc1 acc2)) - ((null? (cdr lst)) (values (cons (car lst) acc1) acc2)) - (else (loop (cddr lst) - (cons (car lst) acc1) - (cons (cadr lst) acc2)))))) - - (define (merge alist blist less) - (let loop ((alist alist) (blist blist) (acc '())) - (cond - ((null? alist) (reverse (append-reverse blist acc))) - ((null? blist) (reverse (append-reverse alist acc))) - (else (let ((a (car alist)) - (b (car blist))) - (if (less a b) - (loop (cdr alist) blist (cons a acc)) - (loop alist (cdr blist) (cons b acc)))))))) - - (cond - ((null? items) items) - ((null? (cdr items)) items) - (else (call-with-values (lambda () (split-reverse items)) - (lambda (alist blist) - (merge (sort alist less) (sort blist less) less))))))) + port)))