Re: [DTrace-devel] [PATCH v2 13/20] doc: Clean up the table for string relational operators

Elena Zannoni <[email protected]>
Newsgroups dev.linux.lists.dtrace
Organization Oracle USA Inc.
Message-ID <[email protected]>
Reviewed-by: Elena Zannoni <[email protected]>


On 10/21/25 9:22 PM, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <[email protected]>
> 
> The text referred to "Table 1", which is not otherwise identified.  It
> included a link using an undefined ID.  Scrap both, especially since the
> table immediately follows the text anyhow.  Clean that up.
> 
> Also, the "String Assignment" link was missing its anchor tag.  Add one.
> 
> While we are at it, for better readability and maintainability of the
> source file:
> 
> - convert the table from HTML to Markdown
> 
> - introduce line breaks into the very long text line
> 
> Signed-off-by: Eugene Loh <[email protected]>
> ---
>  .../dtrace-ref-DTraceSupportforStrings.md     | 73 ++++---------------
>  1 file changed, 14 insertions(+), 59 deletions(-)
> 
> diff --git a/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md b/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md
> index ea44523ed..e9239026f 100644
> --- a/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md
> +++ b/doc/userguide/reference/dtrace-ref-DTraceSupportforStrings.md
> @@ -80,65 +80,21 @@ Scalar type expressions, such as a pointer or integer, or a scalar array address
>  
>  ## String Comparison <a id="dt_strcomp_dlang">
>  
> -D overloads the binary relational operators and permits them to be used for string comparisons, as well as integer comparisons. The relational operators perform string comparison whenever both operands are of type `string` or when one operand is of type `string` and the other operand can be promoted to type `string`. See [String Assignment](dtrace-ref-DTraceSupportforStrings.md) for a detailed description. See also [Table 1](dtrace-ref-DTraceSupportforStrings.md#dt_t14_dlang), which lists the relational operators that can be used to compare strings.
> +D overloads the binary relational operators and permits them to be used for string comparisons, as well as integer comparisons.
> +The relational operators perform string comparison whenever both operands are of type `string`
> +or when one operand is of type `string` and the other operand can be promoted to type `string`.
> +See [String Assignment](dtrace-ref-DTraceSupportforStrings.md#dt_strasg_dlang) for a detailed description.
> +See also the following table, which lists the relational operators that can be used to compare strings.
> +
> +| Operator | Description                                                       |
> +| :---     | :---                                                              |
> +| `<`      | Left-hand operand is less than right-operand.                     |
> +| `<=`     | Left-hand operand is less than or equal to right-hand operand.    |
> +| `>`      | Left-hand operand is greater than right-hand operand.             |
> +| `>=`     | Left-hand operand is greater than or equal to right-hand operand. |
> +| `==`     | Left-hand operand is equal to right-hand operand.                 |
> +| `!=`     | Left-hand operand is not equal to right-hand operand.             |
>  
> -<table><thead><tr><th>
> -
> -Operator
> -
> -</th><th>
> -
> -Description
> -
> -</th></tr></thead><tbody><tr><td>
> -
> -`<`
> -
> -</td><td>
> -
> -Left-hand operand is less than right-operand.
> -
> -</td></tr><tr><td>
> -
> -`<=`
> -
> -</td><td>
> -
> -Left-hand operand is less than or equal to right-hand operand.
> -
> -</td></tr><tr><td>
> -
> -`>`
> -
> -</td><td>
> -
> -Left-hand operand is greater than right-hand operand.
> -
> -</td></tr><tr><td>
> -
> -`>=`
> -
> -</td><td>
> -
> -Left-hand operand is greater than or equal to right-hand operand.
> -
> -</td></tr><tr><td>
> -
> -`==`
> -
> -</td><td>
> -
> -Left-hand operand is equal to right-hand operand.
> -
> -</td></tr><tr><td>
> -
> -`!=`
> -
> -</td><td>
> -
> -Left-hand operand is not equal to right-hand operand.
> -
> -</td></tr><tbody></table>
>  As with integers, each operator evaluates to a value of type `int`, which is equal to one if the condition is true or zero if it is false.
>  
>  The relational operators compare the two input strings byte-by-byte, similarly to the C library routine `strcmp()`. Each byte is compared by using its corresponding integer value in the ASCII character set until a null byte is read or the maximum string length is reached. See the `ascii(7)` manual page for more information. Some example D string comparisons and their results are shown in the following table.
> @@ -179,4 +135,3 @@ Returns 0 \(false\)
>  **Note:**
>  
>  Identical Unicode strings might compare as being different if one or the other of the strings isn't normalized.
> -
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.