wip! compat: Remove upstreamed shims.
This commit is contained in:
parent
c433382563
commit
23280d6f11
|
@ -89,7 +89,6 @@
|
||||||
string-for-each
|
string-for-each
|
||||||
string-every
|
string-every
|
||||||
string-any
|
string-any
|
||||||
the-eof-object
|
|
||||||
noop
|
noop
|
||||||
make-prompt-tag
|
make-prompt-tag
|
||||||
call-with-prompt
|
call-with-prompt
|
||||||
|
@ -110,8 +109,7 @@
|
||||||
exact-integer?
|
exact-integer?
|
||||||
set-program-arguments
|
set-program-arguments
|
||||||
open-file
|
open-file
|
||||||
tmpfile
|
tmpfile)
|
||||||
sort)
|
|
||||||
|
|
||||||
(define-macro (define-inlinable . rest)
|
(define-macro (define-inlinable . rest)
|
||||||
`(define ,@rest))
|
`(define ,@rest))
|
||||||
|
@ -166,8 +164,6 @@
|
||||||
#t
|
#t
|
||||||
(loop (+ k 1)))))))
|
(loop (+ k 1)))))))
|
||||||
|
|
||||||
(define the-eof-object (integer->char -1))
|
|
||||||
|
|
||||||
(define (noop . args) #f)
|
(define (noop . args) #f)
|
||||||
|
|
||||||
(define* (make-prompt-tag #:optional (stem "prompt"))
|
(define* (make-prompt-tag #:optional (stem "prompt"))
|
||||||
|
@ -305,33 +301,4 @@
|
||||||
(port (open name flags)))
|
(port (open name flags)))
|
||||||
;; Delete the file so that it's gone when we're done.
|
;; Delete the file so that it's gone when we're done.
|
||||||
(delete-file name)
|
(delete-file name)
|
||||||
port))
|
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)))))))
|
|
||||||
|
|
Loading…
Reference in New Issue