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

Tidy up core pattern.mjs #179

Closed
yaxu opened this issue Aug 8, 2022 · 2 comments
Closed

Tidy up core pattern.mjs #179

yaxu opened this issue Aug 8, 2022 · 2 comments

Comments

@yaxu
Copy link
Member

yaxu commented Aug 8, 2022

Mainly I have in mind to make sure all pattern methods have equivalent module functions and vice-versa, while removing redundancy.

@yaxu
Copy link
Member Author

yaxu commented Dec 5, 2022

Things are a bit tidier with #274

But there's still a lot of mess. Howabout we make the Pattern class barebones, and build it up dynamically? A function addMethod could take care of adding the method, and optionally patternifying one or more arguments, adding a toplevel module function that's curried and with the pattern as the final argument, etc.

This already mostly exists as Pattern.prototype.define, why not use that for everything?

Then it'd be easy to switch to having the Pattern object be the query function, if we wanted.

@yaxu
Copy link
Member Author

yaxu commented Feb 17, 2023

Things have moved on, so closing this. We can make more specific issues in the future..

@yaxu yaxu closed this as completed Feb 17, 2023
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

1 participant