Github user spmallette commented on a diff in the pull request:
https://github.com/apache/tinkerpop/pull/844#discussion_r183485753
--- Diff: docs/src/reference/the-traversal.asciidoc ---
@@ -2338,6 +2338,22 @@
g.V(1).as("a").repeat(out().as("a")).times(2).select(last, "a")
g.V(1).as("a").repeat(out().as("a")).times(2).select(all, "a")
----
+In addition to the previously shown examples, where `select()` was used to
select an element based on a static key, `select()` can also accept a traversal
+that emits a key.
+
+WARNING: Since the key used by `select(<traversal>)` cannot be determined
at compile time, the `TraversalSelectStep` enables full path tracking.
+
+[gremlin-groovy,modern]
+----
+g.withSideEffect("alias", ["marko":"okram"]).V(). <1>
+ values("name").sack(assign). <2>
+ optional(select("alias").select(sack())) <3>
+----
+
+<1> Inject a name alias map and start the traversal from all vertices.
+<2> Select all `name` values and store them as the current traverser's
sack value.
+<3> Optionally select the alias for the current name from the injected map.
+
--- End diff --
please add the two new `select()` methods to the list of "Additional
References" below.
---