You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "Marko A. Rodriguez (JIRA)" <ji...@apache.org> on 2015/10/17 02:31:05 UTC
[jira] [Created] (TINKERPOP3-895) Use "as BinaryOperator" and
remove GBinaryOperator
Marko A. Rodriguez created TINKERPOP3-895:
---------------------------------------------
Summary: 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
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)