-
Notifications
You must be signed in to change notification settings - Fork 12
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
NOT operator #1
Comments
I will admit that some of the tokens are non-optimal. They were selected based on what characters & symbols users were already commonly using in genders. Although I cannot recall why, some users were using a ! sign already for some purpose. But perhaps this should be revisited. |
Well... that could be alleviated by allowing quoted values:
but that's a whole 'nother can of worms! (And even more overhead in parsing.) Perhaps a --compat flag that would use the old-style parsing? |
Thanks, Grimble! This and your other submissions all look like strong suggestions. Let's see it happen! |
Why using the Polish notation only for the negation operator? I can understand it may be simple to implement, but it makes not consistent with the rest of infix operators. |
My usage of genders is based primarily on nodeattr. I don't find the proposed use of "!" to be inconsistent with shell conventions. Certainly a "not equal" operator is common to most languages, and !expression is equivalent to "not expression" and also "if ! [ test ]" in shell. Perhaps it is inconsistent with a textbook definition of infix operators, but it seems very consistent with the typical callers of nodeattr. Also, I think simple is in keeping with the design objectives of genders. |
While the complement "~(expression)" feature is good, it is syntactically ugly - especially in more complex queries. I would like to see a NOT operator as it would make expressions simpler to write and read. I think the best choice is to use the bang (!) to negate the following expression:
This would allow expressions such as:
rather than:
As I said earlier, I believe the benefit becomes more apparent as the complexity of the query increases.
The text was updated successfully, but these errors were encountered: