Maybe I'm over-reaching this ticket's intentions, but I intend to implement different kinds of aggregations in elastic-gremlin (see list here <https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html>), and something like {{.reduce(R.xxx)}} seems like a good easy way to do it.
On Wed, 5 Aug 2015 at 05:53 Marko A. Rodriguez (JIRA) <[email protected]> wrote: > > [ > https://issues.apache.org/jira/browse/TINKERPOP3-761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14654731#comment-14654731 > ] > > Marko A. Rodriguez commented on TINKERPOP3-761: > ----------------------------------------------- > > I created TINKERPOP3-799. Few things to your comment. > > 1. You can't extend String. If you want the String value, just don't > {{with()}} it. {{...addV('name','x').with('x',select('a').values('name'))}} > 2. I don't see this as the same thing as TINKERPOP3-655 as > {{with()}}-modulation would only be applied to steps that can reasonably > leverage it -- i.e. not every step. > 3. {{select().with('a',...)}} is a nice idea. However, I would say we make > it {{select().by('a',...)}} if people want to be explicit. We can't mix the > meaning of {{with()}} and {{by()}}. One if for changing the arguments of a > step on a per object basis ({{with()}}). The other is for modulating the > incoming values of a step ({{by()}}). > > > Some basic mathematical functions / steps > > ----------------------------------------- > > > > Key: TINKERPOP3-761 > > URL: > https://issues.apache.org/jira/browse/TINKERPOP3-761 > > Project: TinkerPop 3 > > Issue Type: Improvement > > Components: process > > Affects Versions: 3.0.0-incubating > > Reporter: Daniel Kuppitz > > Assignee: Marko A. Rodriguez > > > > Every once in a while I wish to have steps for some basic mathematical > operations ({{add()}}, {{sub()}}, {{mul()}}, {{div()}}). Since {{sub(num)}} > is the same as {{add(-num)}} and {{div(num)}} is the same as > {{mul(1/num)}}, we would only need two new step implementations. > > Oh, and then there's also {{mod()}}, thus 3 new step implementations. > > > > -- > This message was sent by Atlassian JIRA > (v6.3.4#6332) >
