1
Fork 0
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:
Kevin Ryde 2005-03-13 22:49:28 +00:00
parent 6851314445
commit 5df2ac97e9
3 changed files with 45 additions and 14 deletions

View file

@ -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))) '())