Closed dillonforrest closed 10 years ago
If you can, I would like to see a more generic solution, if you think it would be simple enough. Having it be more DRY couldn't hurt. If you don't have time, I could take your code and see what I could come up with.
Apologies, I made the comments on the build file and not the src file. facepalm
@eliperelman hehe it happens to all of us!! :)
I'll work on my next patch later this week or weekend. Thanks for the feedback!! :D
Absolutely, and thanks for your contributions!
Thanks for the PR! These will be moved to npm and the version bumped once I can document them.
My pleasure, buddy! :D
Now live with v0.8.0 with fed32709942e7d988c377e7bf3c120fde3a1d72b. Updates to docs forthcoming.
Awesome, thanks @eliperelman! Congratulations on 0.8.0!! :D
Addresses #9.
Even though @eliperelman and I discussed using
fn.flip
, I ended up usingfn.reverse
on the arguments. I know this leads to more code, but please hear me out. :)After I wrote my fail-first tests, I implemented
fn.curryRight
simply with this:Due to the recursive nature of
fn.curry
, this simple use offn.flip
didn't work. To make all my tests pass and enable the same recursive functionality, I had to basically duplicate the code infn.curry
. So the advantage to usingfn.reverse
with all the additional code is thatfn.curryRight
behaves as expected. The disadvantage is that the code is no longer dry, and that makes me sad.I'm happy to resubmit my pull request if you're okay with me abstracting out the recursive
curry
function insidefn.curry
so that we can reuse it in bothfn.curry
andfn.curryRight
.Otherwise, I tried my best to stay within the pre-existing style, including using tabs over spaces.
What are your thoughts?