Update src/koans/13_recursion.clj #29

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

eric-hu commented Aug 13, 2012

Made a separate function for the factorial function applied to bigints.

The reason for this is that the user gets a java.lang.StackOverflowError exception after successfully implementing a solution for a koan.

The koan in question is titled "Simple things may appear simple.", though there are a few more koans after (but they can be solved in the same step as this one).

eric-hu
Update src/koans/13_recursion.clj
Made a separate function for the factorial function applied to bigints.

The reason for this is that after successfully implementing a solution for the "Simple things may appear simple." koan and the other non-bigint factorial koans, the `script/run` application throws a java.lang.StackOverflowError.  Instead, it should signal to the user that he's working on the next koan.

trptcolin added a commit that referenced this pull request Oct 1, 2012

Owner

trptcolin commented Oct 1, 2012

Hi Eric - sorry it's taken me such a long time to get to this.

I think there are 2 separate issues here: the first is when a StackOverflowError gets thrown, you don't see which koan was the one that failed, and the second is that you need to change the function definition after you've already filled it in.

I definitely think the first one is a bug (and I've addressed that in master), but the second one is behavior that I actually like, since it's the sort of thing we do in programming all the time (improving existing code).

So I'm going to go ahead and close this - thanks for pointing this out!

@trptcolin trptcolin closed this Oct 1, 2012

eric-hu commented Oct 9, 2012

No prob, Colin. Your logic makes sense.

Thanks for maintaining the koans!

jfo pushed a commit to jfo/clojure-koans that referenced this pull request Feb 22, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment