Question: [RACKET] Note: by this point the labs have only covered car, cdr, cons, append, list, length, reverse, member, equal?, eqv?, =, if, cond (including else),

[RACKET]

[RACKET] Note: by this point the labs have only covered car, cdr,

Note: by this point the labs have only covered car, cdr, cons, append, list, length, reverse, member, equal?, eqv?, =, if, cond (including else), lambda, and basic operations (+ - * etc.). This is what instructions mean by only this lab and lab 1.

6. Write a recursive function, retrieve-first-n, that returns a list of the first n elements in a list. Example: > (retrieve-first-n 3 '(a b c d e f g h i)) (a bc) Your code should do something appropriate if n is too big or too small (negative). It doesn't matter to me precisely what it does under these circumstances, so long as it does something reasonable (doesn't crash or return complete nonsense). Your function should not use any other Racket functions than those which have been introduced in this lab and lab 1. An exception: if you wish, you may use the functions , .)

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!