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

Consider: Transformation is open for extension #5

Open
ohpauleez opened this issue May 20, 2019 · 1 comment
Open

Consider: Transformation is open for extension #5

ohpauleez opened this issue May 20, 2019 · 1 comment

Comments

@ohpauleez
Copy link

Currently, transformation is closed for extension, with all the rules for transformation being captured in a cond. Consider introducing a protocol with a single protocol-function (-transform [this source-obj args]) which gets called in place of the exception within the else or in a clause before checking for satisfies?. This would allow users to define new forms of transformation which may be domain specific or are more optimized for their source-obj.

@vvvvalvalval
Copy link
Owner

Yeah I've considered it, I'm just not sure it's worthwhile and I'm being conservative in what features I add.

Consider that:

  1. when you reach this point, maybe it's time you reach out for a more expressive transformation lib like Specter;
  2. any 1-argument function is a valid transformation, and transformations can be combined, so you always have that escape hatch.
  3. opening for extension also means more cases to consider when programmatically manipulating transforms.

I might reconsider at some point, so feel free to post examples of use cases justifying the suggested approach.

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

No branches or pull requests

2 participants