Question
In Scheme, Write a higher order function called filter-list. This filter-list function is a higher order function which means that it takes a function as
In Scheme,
Write a higher order function called filter-list. This filter-list function is a higher order function which means that it takes a function as a parameter and calls it as part of its execution. The filter-list function takes a function as a parameter and a list as a parameter. The function parameter should be a function that takes a single parameter and returns #t or #f. The list parameter is a list.
The filter-list function returns a list of all the items from the list parameter that result with a #t from the function passed in.
Example:
(define greater-than-10 (lambda (num) (if (> num 10)
#t
#f)))
(filter-list greater-than-10 '( 2 3 4 5 6 7 8 9 10 11 12 13)) (11 12 13)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started