Fixed a minor bug; made a small change using FOLDR.

This commit is contained in:
shivers 1999-07-10 05:47:48 +00:00
parent a195317fc8
commit c23ba5b0cb
1 changed files with 7 additions and 8 deletions

View File

@ -55,7 +55,7 @@
;;; Is X a pid or a proc? ;;; Is X a pid or a proc?
(define (pid/proc? x) (or (proc? x) (and (integer? x) (>= pid 0)))) (define (pid/proc? x) (or (proc? x) (and (integer? x) (>= x 0))))
;;; Process reaping ;;; Process reaping
@ -296,13 +296,12 @@
(define reaped-procs '()) ; Reaped, but not yet waited. (define reaped-procs '()) ; Reaped, but not yet waited.
(define (filter-weak-ptr-list pred lis) (define (filter-weak-ptr-list pred lis)
(reverse (reduce (lambda (result wptr) (foldr (lambda (wptr result) (let ((val (weak-pointer-ref wptr)))
(let ((val (weak-pointer-ref wptr))) (if (and val (pred val))
(if (and val (pred val)) (cons wptr result)
(cons wptr result) result)))
result))) '()
'() list))
lis)))
;;; Add a newly-reaped proc to the list. ;;; Add a newly-reaped proc to the list.
(define (add-reaped-proc! pid status) (define (add-reaped-proc! pid status)