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 2016/10/13 18:35:20 UTC
[jira] [Created] (TINKERPOP-1508) Add
choose(predicate,trueTraversal)
Marko A. Rodriguez created TINKERPOP-1508:
---------------------------------------------
Summary: Add choose(predicate,trueTraversal)
Key: TINKERPOP-1508
URL: https://issues.apache.org/jira/browse/TINKERPOP-1508
Project: TinkerPop
Issue Type: Improvement
Components: process
Affects Versions: 3.2.2
Reporter: Marko A. Rodriguez
{{choose()}} supports {{choose(predicateTraversal,trueTraversal,falseTraversal)}}.
I have lots of code that does this:
{code}
choose(blah(), bloop(), identity())
{code}
That is, if the predicate traversal doesn't hold, I simply want the incoming traverser to be emitted -- {{identity()}}. This is sort of like {{optional()}}, but the predicate is something different from the branch. It would be nice to be able to simply say:
{code}
choose(blah(),bloop())
{code}
...where its understood that a "false" means {{identity()}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)