Skip to content

Conversation

@pkulikov
Copy link
Contributor

@pkulikov pkulikov commented Dec 3, 2018

Supports dotnet/docs#9356

Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together @pkulikov

I requested changed, because I Think there's a possible issue in the logic. I could be wrong, but I want to make sure we discuss this and come to agreement before we :shipit:.

Take a look at the comments, and let me know your thoughts.

return Red;
}

return Green;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an issue here. For x & y & z work correctly when z is Yellow, this should return Yellow when one of x or y is Yellow.

Do you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillWagner

For x & y & z work correctly...

to clarify: by "correctly" you mean that the & overload must be associative, so (x & y) & z == x & (y & z)

Yes, I agree then. Will make an update soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@BillWagner I've addressed your feedback; thanks for review.

I've checked the updated definition for all possible x, y, and z values: now the & operator is commutative and associative. In particular, that means that x1 & ... & xN is Yellow iff there is only one operand which is Yellow with all others being Green. That's why I've updated the true definition to return true value for Yellow operand. The following requirement is met:

if only one sub-system is yellow, we can launch.

@BillWagner
Copy link
Member

Thanks for making these updates. I'll :shipit: now and then check the article PR.

@BillWagner BillWagner merged commit 8e9bf43 into dotnet:master Dec 5, 2018
@pkulikov pkulikov deleted the true-false-operators-snippet branch December 5, 2018 15:59
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

Successfully merging this pull request may close these issues.

2 participants