This is an automated email from the ASF dual-hosted git repository.
Cole-Greer pushed a commit to branch 3.8-dev
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/3.8-dev by this push:
new 5a7fb79a41 CTR cleanup 3.8.0 choose upgrade docs example
5a7fb79a41 is described below
commit 5a7fb79a41dc156fb17eda2dc97edc661a30eee8
Author: Cole Greer <[email protected]>
AuthorDate: Wed Sep 23 12:08:21 2026 -0700
CTR cleanup 3.8.0 choose upgrade docs example
---
docs/src/upgrade/release-3.8.0.asciidoc | 58 +++++++++++++++++----------------
1 file changed, 30 insertions(+), 28 deletions(-)
diff --git a/docs/src/upgrade/release-3.8.0.asciidoc
b/docs/src/upgrade/release-3.8.0.asciidoc
index fc01afa80b..f349839983 100644
--- a/docs/src/upgrade/release-3.8.0.asciidoc
+++ b/docs/src/upgrade/release-3.8.0.asciidoc
@@ -700,34 +700,6 @@ gremlin> g.V().local(groupCount("x")).select("x")
Several enhancements and clarifications have been made to the `choose()` step
in TinkerPop 3.8.0 to improve its behavior
and make it more consistent:
-*First Matched Option Only*
-
-The `choose()` step now only executes the first matching option traversal. In
previous versions, if multiple options
-could match, all matching options would be executed. This change provides more
predictable behavior and better aligns
-with common switch/case semantics in programming languages.
-
-[source,text]
-----
-// In 3.7.x and earlier, if multiple options matched, all would be executed
-gremlin> g.V().hasLabel("person").
-......1> choose(__.values("age")).
-......2> option(P.between(26, 30), __.constant("young")).
-......3> option(P.between(20, 30), __.constant("also young"))
-==>young
-==>also young
-==>young
-==>also young
-
-
-// In 3.8.x, only the first matching option is executed
-gremlin> g.V().hasLabel("person").
-......1> choose(__.values("age")).
-......2> option(P.between(26, 30), __.constant("young")).
-......3> option(P.between(20, 30), __.constant("never reached for ages
26-30"))
-==>young
-==>young
-----
-
*Automatic Pass-through for Unproductive and Unmatched Predicates*
The `choose()` step now passes through traversers when the choice traversal is
unproductive or the determined choice
@@ -757,6 +729,36 @@ gremlin> g.V().choose(T.label).
This change makes the switch semantics for `choose()` consistent with those of
the if-then-else semantics for
`choose()`.
+*First Matched Option Only*
+
+The `choose()` step now only executes the first matching option traversal. In
previous versions, if multiple options
+could match, all matching options would be executed. This change provides more
predictable behavior and better aligns
+with common switch/case semantics in programming languages.
+
+[source,text]
+----
+// In 3.7.x and earlier, if multiple options matched, all would be executed
+gremlin> g.V().hasLabel("person").
+......1> choose(__.values("age")).
+......2> option(P.between(26, 30), __.constant("young")).
+......3> option(P.between(20, 30), __.constant("also young"))
+==>young
+==>also young
+==>young
+==>also young
+
+
+// In 3.8.x, only the first matching option is executed
+gremlin> g.V().hasLabel("person").
+......1> choose(__.values("age")).
+......2> option(P.between(26, 30), __.constant("young")).
+......3> option(P.between(20, 30), __.constant("never reached for ages
26-30"))
+==>young
+==>young
+==>v[4]
+==>v[6]
+----
+
*Pick.unproductive for Unproductive Predicates*
A new special option token `Pick.unproductive` has been added to handle cases
where the choice traversal produces no