Skip to content

Merged relational+boolean operators? #4980

Discussion options

You must be logged in to vote

Since we have relational patterns now, you should be able to write this:

if (j is < dateStart or > dateEnd) throw new NotImplementedException();
if (j is x or y or z or < 1000) throw new NotImplementedException();

But unfortunately they don't allow comparisons with variables, only constants. I'd much rather we augmented this existing syntax to allow non-constant comparisons; I think that's a lot better than introducing new operators.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Daynvheur
Comment options

Comment options

You must be logged in to vote
1 reply
@Daynvheur
Comment options

Answer selected by Daynvheur
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants