This is an automated email from the ASF dual-hosted git repository. xiazcy pushed a commit to branch type-enum-poc in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
commit 0ae19cdac0fe5ca55394319c6626162a75e9c670 Author: Yang Xia <[email protected]> AuthorDate: Mon Jul 28 08:24:29 2025 -0700 Apply suggestions from code review Co-authored-by: andreachild <[email protected]> --- docs/src/upgrade/release-3.8.x.asciidoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/src/upgrade/release-3.8.x.asciidoc b/docs/src/upgrade/release-3.8.x.asciidoc index 2e04c587b2..31e9738afc 100644 --- a/docs/src/upgrade/release-3.8.x.asciidoc +++ b/docs/src/upgrade/release-3.8.x.asciidoc @@ -32,13 +32,13 @@ complete list of all the modifications that are part of this release. ==== Number Conversion Step -We have been iterative introducing new language features into Gremlin, with the last major set of string, list and date manipulation +We have been iteratively introducing new language features into Gremlin, with the most recent major additions being string, list and date manipulation steps introduced in the 3.7 line. In 3.8.0, we are now introducing a number conversion step, `asNumber()`, to bridge a gap in casting functionalities. The new `asNumber()` serves as an umbrella step that parses strings and casts numbers into desired types. For the convenience of remote traversals in GLVs, these number types are denoted by a set of number tokens (`N`). -This new step will allow users to normalize their data by converting string numbers and mixed numeric types to consistent format, making it easier to perform downstream mathematical operations. As an example: +This new step will allow users to normalize their data by converting string numbers and mixed numeric types to a consistent format, making it easier to perform downstream mathematical operations. As an example: [source,text] ---- @@ -55,17 +55,17 @@ gremlin> g.inject(1.0, 2l, 3, "4", "0x5").asNumber().sum().asNumber(N.nint) ==>15 ---- -Semantically, the `asNumber()` step will convert the incoming traverser to the nearest parsable type if no argument is provided, or to the desired numerical type, based on the number token (`N`) provided. +Semantically, the `asNumber()` step will convert the incoming traverser to a logical parsable type if no argument is provided, or to the desired numerical type, based on the number token (`N`) provided. -Numerical input will pass through unless a type is specified by the number token. `ArithmeticException` will be thrown for any overflow during narrowing of types: +Numerical input will pass through unless a type is specified by the number token. `ArithmeticException` will be thrown for any overflow as a result of narrowing of types: [source,text] ---- gremlin> g.inject(5.0).asNumber(N.nint) ==> 5 // casts double to int -gremlin> g.inject(12).asNumber(N.byte) +gremlin> g.inject(12).asNumber(N.nbyte) ==> 12 -gremlin> g.inject(128).asNumber(N.byte) +gremlin> g.inject(128).asNumber(N.nbyte) ==> ArithmeticException ---- @@ -75,7 +75,7 @@ String input will be parsed. By default, the smalled unit of number to be parsed ---- gremlin> g.inject("5").asNumber() ==> 5 -gremlin> g.inject("5.7").asNumber(N.int) +gremlin> g.inject("5.7").asNumber(N.nint) ==> 5 gremlin> g.inject("1,000").asNumber(N.nint) ==> NumberFormatException
