Closed rafinskipg closed 10 years ago
Thanks for reporting the issue and adding the representative test cases for reproduce the trouble
You are right, there was an issue with the curry function.
The curried arguments are stored persistently (like using the memoization technique) in an array of arguments that shares the same scope in the subsequent call to the curried function. This causes that each curry() call creates a "new instance" of itself and cannot be used from other context in the case that the partial function be cached and reused with other arguments
In order to solve this issue, I done a complete refactor of the curry function that is a pure-function with continuous passing-style method to avoid object mutability and inner scope dependency
You can take a look to the new implementation here. Additionally, I added some more test cases to cover different use cases, you may take a look here
I just released a new version 0.1.0-rc.2
and its available from npm
and bower
, just re-provision your dependency
Thanks again for your time!
Closing issue!
Awesome! Thanks!
Hi, maybe I missunderstood something, but I expected "curry" to work in other way
And this is the result: