Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-1508

Add choose(predicate,trueTraversal)

VotersStop watchingWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.2.2
    • 3.3.0, 3.2.4
    • process
    • None

    Description

      choose() supports choose(predicateTraversal,trueTraversal,falseTraversal).

      I have lots of code that does this:

      choose(blah(), bloop(), identity())
      

      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:

      choose(blah(),bloop())
      

      ...where its understood that a "false" means identity().

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            okram Marko A. Rodriguez
            okram Marko A. Rodriguez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment