LISP SICP Video Lecture 2a Average Damp Question

The average-damp procedure takes a procedure as its argument and returns a procedure as its value. When given a procedure that takes one argument, average-damp returns another procedure that computes the average of the values before and after applying the original function f to its argument. It’s inside the fixed-point procedure where that returned function … Read more

reversing list in Lisp

Your code as written is logically correct and produces the result that you’d want it to: That said, there are some issues with it in terms of performance. The append function produces a copy of all but its final argument. E.g., when you do (append ‘(1 2) ‘(a b) ‘(3 4)), you’re creating a four new cons cells, … Read more