[ 
https://issues.apache.org/jira/browse/TINKERPOP3-895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14961983#comment-14961983
 ] 

ASF GitHub Bot commented on TINKERPOP3-895:
-------------------------------------------

GitHub user okram opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/111

    TINKERPOP3-895: Use "as BinaryOperator" and remove GBinaryOperator

    https://issues.apache.org/jira/browse/TINKERPOP3-895
    
    The full test suite has passed. Integration tests not required as this does 
not effect the semantics of a traversal beyond `GraphTraversalSource` 
construction in Gremlin-Groovy.
    
    Respective lambda wrappers deprecated.
    
    No AsciiDoc documentation updates required. Will update CHANGELOG on merge 
to master/.
    
    VOTE: +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/incubator-tinkerpop TINKERPOP3-895

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/111.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #111
    
----
commit aee7937bac99da518865c504e6870d0b2216b066
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2015-10-17T16:57:15Z

    There is no need to have Closure wrappers to make Groovy closures line up 
with Java lambdas. The trick is to simply 'as Function' the closure and it is 
assumed to be a java.util.function.Function. I deprecated all of our GXXX 
closure to lambda wrappers and full test suite passes without an ambiguous 
method calls from Gremlin-Groovy.

----


> Use "as BinaryOperator" and remove GBinaryOperator
> --------------------------------------------------
>
>                 Key: TINKERPOP3-895
>                 URL: https://issues.apache.org/jira/browse/TINKERPOP3-895
>             Project: TinkerPop 3
>          Issue Type: Bug
>          Components: process
>    Affects Versions: 3.0.2-incubating
>            Reporter: Marko A. Rodriguez
>            Assignee: Marko A. Rodriguez
>              Labels: breaking
>             Fix For: 3.1.0-incubating
>
>
> In Gremlin-Groovy we have function wrappers like {{GSupplier}}, 
> {{GFunction}}, {{GBinaryOperator}}, etc. which I use to wrap closures so that 
> {{GraphTraversal}} methods know what the closure represents. I just learned 
> you can do this:
> {code}
> sackSum = { a,b ->
>   [a[0] + b[0],a[1] + b[1]]
> } as BinaryOperator
> {code}
> WOW! That is a huge saving in terms of code management.
> This is breaking if people are using {{GXXX}} for something, however, with 
> {{as XXX}}, they shouldn't be using {{GXXX}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to