mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-22 19:44:10 +02:00
(find, find-tail): Rewrite in C.
This commit is contained in:
parent
6851314445
commit
5df2ac97e9
3 changed files with 45 additions and 14 deletions
|
@ -578,20 +578,6 @@
|
|||
|
||||
;;; Searching
|
||||
|
||||
(define (find pred clist)
|
||||
(if (null? clist)
|
||||
#f
|
||||
(if (pred (car clist))
|
||||
(car clist)
|
||||
(find pred (cdr clist)))))
|
||||
|
||||
(define (find-tail pred clist)
|
||||
(if (null? clist)
|
||||
#f
|
||||
(if (pred (car clist))
|
||||
clist
|
||||
(find-tail pred (cdr clist)))))
|
||||
|
||||
(define (take-while pred ls)
|
||||
(cond ((null? ls) '())
|
||||
((not (pred (car ls))) '())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue