| Recursion and Higher-order Functions - slide 15 : 35 |
;; A simple linear list search function.
;; Return the first element which satisfies the predicate pred.
;; If no such element is found, return #f.
(define (find-in-list pred lst)
(cond ((null? lst) #f)
((pred (car lst)) (car lst))
(else (find-in-list pred (cdr lst))))) Index in list |
Binary search in sorted vectors |
Generating a C-style compare function |
Higher-order functions in 'Functional Programming Languages' |







