How do I change elements of list in Scheme. I want a procedure to change the minimum elements of a list to another number, so
If I have a procedure called proc and I give it two arguments ( a list and a number), my procedure would work like this:
(proc (list 1 2 3 1) 9) returns '(9 2 3 9). so 9 take the place of the minimum value(s) of the list. I know I can apply min to get the minimum value, but I don't know how to modify a single element of the list.
Since Scheme doesn't have variables to hold values, I thought about using either let or letrec, but I don't know which would be the difference between using let and letrec.