-
Notifications
You must be signed in to change notification settings - Fork 254
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
comparing two boolean values and the unary 'not' #217
Comments
Just a couple of chapters further on:
this solves the first issue: x y xor |
You could implement boolean not logic using a Coalesce step
|
Also I updated the section that talks about |
a small change to your example: 'GraphTraversalSource" object has no attribute 'coalesce', you'll need g.V() My Python implementation:
|
In my example above the |
I used About V(): yes, I already have inadvertently doubled all vertices in the database when I used g.V().addV(...) , wondering where all those vertices came from... on the side: |
Now that work has started on a second edition we will take the remaining discussions in this issue as part of that work. |
This is not an issue, but a request for a smarter solution,
I would like to compare two boolean values with an 'is' operator. But that operator is not available for groovysh_evaluate.
When I try to negate a boolean value, there is no operator for that either.
In the end I wrote a solution with a .choose, comparing with constant(true), see below.
Another solution is to convert boolean to int 0 and 1 and then use .math('x - y'), when that gives 0, the booleans are the same.
I can't believe that there is no shorter way to achieve this.
This determines the exclusive-or for the values in as('x') and as('y'):
The text was updated successfully, but these errors were encountered: