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

Feature: each-is #11

Open
subsetpark opened this issue Aug 11, 2021 · 5 comments
Open

Feature: each-is #11

subsetpark opened this issue Aug 11, 2021 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@subsetpark
Copy link
Collaborator

subsetpark commented Aug 11, 2021

Add a new macro, each-is:

each-is forms &opt note

forms should be a tuple or array of assertion forms, of the same kind understood by is.

(each-is @[foo bar baz] "note") is equivalent to:

(is foo "note")
(is bar "note")
(is baz "note")

original issue text:

(is @[foo bar baz] note) would be equivalent to (is foo note) (is bar note) ...

@subsetpark subsetpark added the enhancement New feature or request label Aug 11, 2021
@pyrmont
Copy link
Owner

pyrmont commented Aug 12, 2021

Would it be better to have a separate are macro for this? While this looks helpful in the abstract, it also seems to confuse the semantics of is. To be clear, it doesn't have to be are and could be something that makes the relationship to is clearer (e.g. is-multi, is-group, iss, etc).

@subsetpark
Copy link
Collaborator Author

Yeah, I think that’s right. I’m not a fan of those bdd-style libraries that try to give you an English word for everything you might want to say, but the aim of keeping a simple and consistent semantics for the function itself is quite worthwhile.

@pyrmont
Copy link
Owner

pyrmont commented Aug 13, 2021

Yeah, I'm similar. I'm a worried that are is a little too clever by half. I didn't really like the other alternatives, though. If it was a separate macro, do you have a name you'd prefer? is-all? is-every?

@subsetpark
Copy link
Collaborator Author

each-is maybe? each is already a word

@pyrmont
Copy link
Owner

pyrmont commented Aug 17, 2021

That one sounds good to me: clear and easy to understand.

@subsetpark subsetpark changed the title Accept array in is? Feature: each-is Aug 17, 2021
@subsetpark subsetpark added the good first issue Good for newcomers label Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants