Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0604-Correct-some-details-in-the-operator-table...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0604-Correct-some-details-in-the-operator-table.patch of Package erlang
From e91f8ddc34b7dd8a8c21bc4b3664c902857b4c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Thu, 15 Dec 2022 09:41:15 +0100 Subject: [PATCH] Correct some details in the operator table * Change "priority" to the standard terminology "precedence". * Document the changed precedence of the `catch` operator. * Mention the restrictions of `?=` in a note after the operand table. * Mark the non-associative binary operators as such in the operand table. --- system/doc/reference_manual/expressions.xml | 64 +++++++++++++++------ 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/system/doc/reference_manual/expressions.xml b/system/doc/reference_manual/expressions.xml index 341fa32432..5b96c50065 100644 --- a/system/doc/reference_manual/expressions.xml +++ b/system/doc/reference_manual/expressions.xml @@ -1835,49 +1835,57 @@ end</pre> </row> <row> <cell align="left" valign="middle">/ * div rem band and</cell> - <cell align="left" valign="middle">Left associative</cell> + <cell align="left" valign="middle">Left-associative</cell> </row> <row> <cell align="left" valign="middle">+ - bor bxor bsl bsr or xor</cell> - <cell align="left" valign="middle">Left associative</cell> + <cell align="left" valign="middle">Left-associative</cell> </row> <row> <cell align="left" valign="middle">++ --</cell> - <cell align="left" valign="middle">Right associative</cell> + <cell align="left" valign="middle">Right-associative</cell> </row> <row> <cell align="left" valign="middle">== /= =< < >= > =:= =/=</cell> - <cell align="left" valign="middle"> </cell> + <cell align="left" valign="middle">Non-associative</cell> </row> <row> <cell align="left" valign="middle">andalso</cell> - <cell align="left" valign="middle"> </cell> + <cell align="left" valign="middle">Left-associative</cell> </row> <row> <cell align="left" valign="middle">orelse</cell> - <cell align="left" valign="middle"> </cell> - </row> - <row> - <cell align="left" valign="middle">= !</cell> - <cell align="left" valign="middle">Right associative</cell> + <cell align="left" valign="middle">Left-associative</cell> </row> <row> <cell align="left" valign="middle">catch</cell> <cell align="left" valign="middle"> </cell> </row> + <row> + <cell align="left" valign="middle">= !</cell> + <cell align="left" valign="middle">Right-associative</cell> + </row> <tcaption>Operator Precedence</tcaption> </table> + <p>Before Erlang/OTP 24, the <c>catch</c> operator had the lowest + precedence.</p> <p>When evaluating an expression, the operator with the highest - priority is evaluated first. Operators with the same priority - are evaluated according to their associativity.</p> - <p><em>Example:</em></p> - <p>The left associative arithmetic operators are evaluated left to + precedence is evaluated first. Operators with the same precedence + are evaluated according to their associativity. Non-associative + operators cannot be combined with operators of the same precedence.</p> + <p><em>Examples:</em></p> + <p>The left-associative arithmetic operators are evaluated left to right:</p> <pre> <input>6 + 5 * 4 - 3 / 2</input> evaluates to <input>6 + 20 - 1.5</input> evaluates to <input>26 - 1.5</input> evaluates to <input>24.5</input></pre> + +<p>The non-associative operators cannot be combined:</p> + <pre> +1> <input>1 < X < 10.</input> +* 1:7: syntax error before: '<'</pre> </section> </chapter> -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor