-
Notifications
You must be signed in to change notification settings - Fork 108
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
fnk binding form can't combine optional parameters with destructuring #114
Comments
Thanks for the report. This is currently by design -- I don't see an easy way to provide a default in the case that the sub-form binds more than one symbol, and the semantics of what's required vs. optional isn't exactly clear (does this mean that :sub is optional, but if present must contain a foo?). Given the complexities, we've felt that in such cases, we're probably better just using what Clojure provides already. But if you have a concrete proposal for how you'd like this to work that covers all the cases, we'd be happy to consider it. |
@w01fe Thanks for the speedy reply. I wondered if this was the case. I'd be happy to write up a proposal / work on implementing it if y'all approved. I'm getting over a headcold (hence my delayed response) but I'll try to get to that proposal soon. |
Sounds good, thanks for the offer! If you can prepare something along the lines of the "fnk syntax proposal" here: https://github.com/plumatic/plumbing/tree/master/src/plumbing/fnk that covers all the cases that would be ideal, and we can review and take things from there. Cheers! |
👍 |
When defining a fnk, I'd hope to be able to do something like this:
to get back 2. Unfortunately, combining the optional {} syntax with the [] destructuring syntax does not work:
The text was updated successfully, but these errors were encountered: