wip! compat: Remove upstreamed shims.

This commit is contained in:
Timothy Sample 2023-08-13 00:37:00 -06:00
parent c433382563
commit 23280d6f11
1 changed files with 2 additions and 35 deletions

View File

@ -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)))