I'm looking for help in writing a function that returns a list of the first 15 cubes. Here's what I have so far, and I'm getting a stack overflow:
(defun cubes (dec lst) ;takes a number and a list as params
(if (= dec 0) lst ;if dec is 0 return the list
(cons (threes (- dec 1) lst))) ;;else decrement and call it again
)
I am calling it with the following code:
(cubes 15 nil) ;should print first 15 cubes
I just started on LISP today. Thanks for the help!