mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 08:20:20 +02:00
(remove-if, remove-if-not): Fix typo: use
`pred', not `pred?', in the body.
This commit is contained in:
parent
4ff9f8254e
commit
45cf8cd6aa
1 changed files with 2 additions and 2 deletions
|
@ -206,7 +206,7 @@ If found, return that element, otherwise return #f."
|
||||||
Return everything that's left."
|
Return everything that's left."
|
||||||
(let loop ((l l) (result '()))
|
(let loop ((l l) (result '()))
|
||||||
(cond ((null? l) (reverse! result))
|
(cond ((null? l) (reverse! result))
|
||||||
((pred? (car l)) (loop (cdr l) result))
|
((pred (car l)) (loop (cdr l) result))
|
||||||
(else (loop (cdr l) (cons (car l) result))))))
|
(else (loop (cdr l) (cons (car l) result))))))
|
||||||
|
|
||||||
(define-public (remove-if-not pred l)
|
(define-public (remove-if-not pred l)
|
||||||
|
@ -214,7 +214,7 @@ Return everything that's left."
|
||||||
Return everything that's left."
|
Return everything that's left."
|
||||||
(let loop ((l l) (result '()))
|
(let loop ((l l) (result '()))
|
||||||
(cond ((null? l) (reverse! result))
|
(cond ((null? l) (reverse! result))
|
||||||
((not (pred? (car l))) (loop (cdr l) result))
|
((not (pred (car l))) (loop (cdr l) result))
|
||||||
(else (loop (cdr l) (cons (car l) result))))))
|
(else (loop (cdr l) (cons (car l) result))))))
|
||||||
|
|
||||||
(define-public (delete-if! pred l)
|
(define-public (delete-if! pred l)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue