You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/04/12 22:02:46 UTC

[GitHub] [groovy] eric-milles commented on pull request #1558: GROOVY-9017 DGM methods

eric-milles commented on pull request #1558:
URL: https://github.com/apache/groovy/pull/1558#issuecomment-818271807


   `and` and `or` work because they are binary operations so you can write "if (a.and(b))".  `not` is a unary operation semantically.  So the way you have it you could have "if (a.not())".  Are you looking for "if (not(a))"?  For that, you could supply a DGM like this:
   ```java
   public static Boolean not(Object self, Boolean target)
   ```
   With this, you could write "if (not(a))" and "self" would the the object that is the implicit "this", which you can ignore.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org