I'm trying to design a function called changeList that modifies a list in scheme.
The function should drop each number between -1 and +1 inclusive. For each number greater than 1 it should replace the number with 10 times the number. For each number smaller than -1 it should replace the number with the absolute value of the reciprocal.
Here's the code I have so far
(define (changeList x)
(map (lambda (x)
(if (> x 1) (* x 10)
(* (/ 1 x) -1))) x))
Here's an example of the desired output
(changeList '(0 -2 3 -4 1))
-> '( 1/2 30 1/4 )
I'm able to evaluate if x if greater than 1 and if x is smaller than -1, however I'm having issues adding the conditional statements to evaluate if the value is between -1 and 1 inclusively. I need to skip that value and not output it which I'm not sure how to do it.