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

Allow destructuring in p/for #8

Closed
ferdinand-beyer opened this issue Jun 6, 2023 · 1 comment
Closed

Allow destructuring in p/for #8

ferdinand-beyer opened this issue Jun 6, 2023 · 1 comment

Comments

@ferdinand-beyer
Copy link

The for macro asserts that the binding form is a symbol:

(assert (symbol? sym) (str "Requires symbol for binding name: " sym))

This restriction seems unnecessary, and prevents users from using destructuring:

(p/parse (p/for [[x & xs] (p/*many char/number?)]
           (p/result {:first x, :rest xs}))
         "12345")

Maybe we can remove the assert?

serioga added a commit that referenced this issue Jun 6, 2023
@serioga
Copy link
Member

serioga commented Jun 6, 2023

Removed the assert :-)

@serioga serioga closed this as completed Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants