-
Notifications
You must be signed in to change notification settings - Fork 13
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
and() logical operator returns leftover number items when arrays are passed #8
Comments
Oh interesting! The previous behavior seems definitely suboptimal. |
I think we were discussing this a couple days ago. If I remember right, you suggested that when one list is shorter it should be extended with the operator's identity element---which in this case would be true, so returnins false, false, 2, 3 would be correct. |
ya, I agree that maybe we should change the (also it's weird that I'm typing a response to you rather than talking to you who was right behind me. I guess I'm preparing for your leave in July, LOL) |
the identity for and has to be true, because that's the only thing that has no effect when combined with other args. |
Does it make sense to you though?
Not weird. This is asynchronous, which means I can choose to see it when I take a break and/or am less focused, so it's preferable for things that can wait (i.e. if you’re not stuck). |
Wait, extending with identity meaning that the shorter array, in that example is Also, the order of the array parameters should not affect the result of the operation right? |
So I was fixing the "bug" with
binaryOperation()
, and made changes so that new and old tests passed, except one:This doesn't really make sense to me because
and()
and thecontains()
I'm implementing now are similar in that they both return booleans. We already established that thecontains()
function should only return booleans and instead of adding unprocessed array items into the return array. Yet here, the expected result of theand()
does the exact thing that we decided is not right.Should this be fixed or is there a difference between
and()
andcontains()
in terms of what they should return that I'm missing here?The text was updated successfully, but these errors were encountered: