From c23ba5b0cb1cd75cdf1dec0cb94d5e5950fd8cbd Mon Sep 17 00:00:00 2001 From: shivers Date: Sat, 10 Jul 1999 05:47:48 +0000 Subject: [PATCH] Fixed a minor bug; made a small change using FOLDR. --- scsh/procobj.scm | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/scsh/procobj.scm b/scsh/procobj.scm index 5849ab1..64008c1 100644 --- a/scsh/procobj.scm +++ b/scsh/procobj.scm @@ -55,7 +55,7 @@ ;;; 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 @@ -296,13 +296,12 @@ (define reaped-procs '()) ; Reaped, but not yet waited. (define (filter-weak-ptr-list pred lis) - (reverse (reduce (lambda (result wptr) - (let ((val (weak-pointer-ref wptr))) - (if (and val (pred val)) - (cons wptr result) - result))) - '() - lis))) + (foldr (lambda (wptr result) (let ((val (weak-pointer-ref wptr))) + (if (and val (pred val)) + (cons wptr result) + result))) + '() + list)) ;;; Add a newly-reaped proc to the list. (define (add-reaped-proc! pid status)