diff options
author | Timothy Sample <samplet@ngyro.com> | 2023-08-13 00:37:00 -0600 |
---|---|---|
committer | Timothy Sample <samplet@ngyro.com> | 2023-08-13 00:38:05 -0600 |
commit | 23280d6f118518c278acd06be2c7b8131ddecfbd (patch) | |
tree | 12c0668c73d34f1d6624ab21e6c3bed9d1c35ed5 | |
parent | c433382563586b3be40bd7c26223b6e77fc75b96 (diff) |
wip! compat: Remove upstreamed shims.wip-modular-mes
-rw-r--r-- | gash/compat.scm | 37 |
1 files 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))) |