Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method Chaining or Currying #10

Open
siromivel opened this issue Feb 24, 2019 · 1 comment
Open

Method Chaining or Currying #10

siromivel opened this issue Feb 24, 2019 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@siromivel
Copy link
Owner

Ok, this one's a bit of a doozy. The 0.x Lambdeth API is similar to Lodash and doesn't allow easy currying. It's an open question whether or not implementing chaining or currying is even a good idea as it may invite users to write extremely costly lines of code. Method chaining will definitely take some work to implement in Solidity but I think it may be possible with some creativity.

@siromivel siromivel added question Further information is requested enhancement New feature or request labels Feb 24, 2019
@siromivel siromivel self-assigned this Mar 12, 2019
@siromivel siromivel removed the question Further information is requested label Mar 12, 2019
@siromivel
Copy link
Owner Author

I'm going ahead and refactoring the library so that all relevant methods support currying. This is easy to accomplish by simply passing the input array as the last argument. I didn't do this initial as I was trying to create an API that is identical to Lodash for developers coming from a JS environment, the more I've thought about how to make methods chainable currying seems like the best solution to me as it doesn't involve making the contract any larger or writing any complex and potentially dangerous internal logic/structs to support method chaining ala Lodash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant