[
https://issues.apache.org/jira/browse/TINKERPOP3-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Marko A. Rodriguez closed TINKERPOP3-900.
-----------------------------------------
Resolution: Won't Fix
This is a bad idea. Why is this a bad idea? {{by(string)}} turns into
{{by(select(string))}}. Thus, if we did {{by(object)}} to support
{{constant(object)}}, {{String}} arguments would have to be treated "special"
as {{String}} would assume you were doing an {{ElementPropertyValueTraversal}}.
This same phenomena crept its head in the {{to()}}/{{from()}}-modulators of the
new write API and it was decided there not to make a "special situation." As
such, I think {{constant(0)}} (sack) like {{select(string)}} (mutation steps)
is the best way.
Thus, this ticket is null and void. If someone has an argument against this
reasoning, please feel free to reopen.
> Provide by(object) which compiles to by(constant(object))
> ---------------------------------------------------------
>
> Key: TINKERPOP3-900
> URL: https://issues.apache.org/jira/browse/TINKERPOP3-900
> Project: TinkerPop 3
> Issue Type: Improvement
> Components: process
> Affects Versions: 3.0.2-incubating
> Reporter: Marko A. Rodriguez
> Assignee: Marko A. Rodriguez
> Fix For: 3.1.0-incubating
>
>
> Right now, this is how you can increment a sack.
> {code}
> sack{a,b -> a+1}
> {code}
> OR, lambda free:
> {code}
> sack(sum).by(constant(1))
> {code}
> I think we should make a {{by()}}-modulator that is:
> {code}
> sack(sum).by(1)
> {code}
> That is:
> {code}
> by(object) -> by(constant(0)).
> {code}
> In fact, we have an {{AbstractLambdaTraversal}} called {{ConstantTraversal}}
> which will make this even faster (analogous to {{LoopTraversal}} being used
> instead of {{until(loops().gt(4))}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)