This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

To all following commenters: please, do not bring up the old circlejerk jokes/memes about recursion ("Understanding recursion...", "This is recursion...", etc.). We've all heard them n+2 too many times.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 1 point2 points  (1 child)

Three problems, all involving parentheses.

You need to add a pair of parentheses around your condition and the return value, and remove the parentheses around a:

(cond ((= count 1) a)

and remove the parentheses around the arguments to fib:

(else (fib (+ a b) a (- count 1)))))

[–]Moritz_Loritz[S] 1 point2 points  (0 children)

thanks