Question: please use language : scheme Part 4 - Writing a simple filter-list function Write a 'higher order function' called filter-list. This filter-list function is a

 please use language : scheme Part 4 - Writing a simple

please use language : scheme

Part 4 - Writing a simple filter-list function 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. Note - Don't get bogged down in defensive programming here. It's ok to let this function error if your user doesn't pass in the right things. Scheme does the same thing on its higher order functions. 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: (detine greater-than-10 (labda (num) (> num 10) (Filter-list greater-than-10 1 2 3 4 5 6 7 8 9 10 11 12 13)) (11 12 13) Hint: You should test this with your not-divisible-by ..) function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!