Question: Help for racket Write a structurally recursive function (collect f lon) that takes two arguments, a one-argument function f and a list of numbers lon.

Help for racket

Write a structurally recursive function (collect f lon) that takes two arguments, a one-argument function f and a list of numbers lon.

  ::= () | ( . ) 

collect returns a list of items f(i) for every i in lon. For example:

 > (collect square '(1 2 -1 -2 3 -3 5 -4 4)) '(1 4 1 4 9 9 25 16 16)

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!