Material to Understand

Exercises

  1. Write a recursive function called my-mapcar that produces the same results as mapcar, but does not use mapcar. For example, (my-mapcar #'oddp '(1 2 3)) should return (t nil t).
  2. Write a recursive function called my-remove-if that produces the same results as remove-if. For example, (my-remove-if #'oddp '(1 2 3)) should return (2).
  3. Write a recursive function called my-count-if that produces the same results as count-if. For example, (my-count-if #'oddp '(1 2 3)) should return 2.
  4. Write a recursive function called my-find-if that produces the same results as find-if. For example, (my-find-if #'oddp '(1 2 3) should return 1.
  5. Call my-find-if with a lambda function of your own choosing.
  6. Explain the difference between funcall and apply.