From 51a3c607cfd4df68fc004d13431f874a55cef739 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Mon, 1 Jul 2019 13:01:40 +0200 Subject: [PATCH] Documentation: Move operators to the Operators chapter. They were hidden in the "The rest" chapter... Also adds some minimal documentation of the **-operator. --- refdoc/chapters/operators.xml | 40 +++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/refdoc/chapters/operators.xml b/refdoc/chapters/operators.xml index 240e376d48..cb89eb999f 100644 --- a/refdoc/chapters/operators.xml +++ b/refdoc/chapters/operators.xml @@ -42,6 +42,10 @@ you remember from math in school. The arithmetic operators are:</p> <c><expr>a % b</expr></c> <c><expr>`%</expr></c> <c>the remainder of a division between a and b</c></r> +<r><c>Exponentiation</c> + <c><expr>a ** b</expr></c> + <c><expr>`**</expr></c> + <c>the result of raising a to the b:th power</c></r> </matrix> <p>The third column, "Identifier" is the name of the function that actually @@ -258,6 +262,13 @@ float % int</code></c> </matrix> +<insert-move entity="predef::.`+"/> +<insert-move entity="predef::.`-"/> +<insert-move entity="predef::.`*"/> +<insert-move entity="predef::.`/"/> +<insert-move entity="predef::.`%"/> +<insert-move entity="predef::.`**"/> + </section> <section title="Comparison operators"> @@ -316,6 +327,13 @@ to a float before the comparison. When comparing strings, lexical order is used and the values of the environment variables <tt>LC_CTYPE</tt> and <tt>LC_LANG</tt> are respected.</p> +<insert-move entity="predef::.`=="/> +<insert-move entity="predef::.`!="/> +<insert-move entity="predef::.`>"/> +<insert-move entity="predef::.`>="/> +<insert-move entity="predef::.`<"/> +<insert-move entity="predef::.`<="/> + </section> <section title="Logical operators"> @@ -323,8 +341,9 @@ used and the values of the environment variables <tt>LC_CTYPE</tt> and <p>Logical operators are operators that operate with truth values. In Pike any value except zero is considered <b>true</b>. Logical operators are a very basic part of Pike. They can also decide which arguments to evaluate and which not to -evaluate. Because of this the logical operators do not have any identifiers and -can not be called as normal functions. There are four logical operators:</p> +evaluate. Because of this most of the logical operators do not have any +identifiers and can not be called as normal functions. There are four +logical operators:</p> <matrix> @@ -353,6 +372,8 @@ can not be called as normal functions. There are four logical operators:</p> </matrix> +<insert-move entity="predef::.`!"/> + </section> <section title="Bitwise/set operators"> @@ -420,6 +441,13 @@ the indices. If a particular index is present in both the right and left argument to a set operator, the one from the right side will be used. Example: <expr>([1:2]) | ([1:3])</expr> will return <expr>([1:3])</expr>.</p> +<insert-move entity="predef::.`<<"/> +<insert-move entity="predef::.`>>"/> +<insert-move entity="predef::.`~"/> +<insert-move entity="predef::.`&"/> +<insert-move entity="predef::.`|"/> +<insert-move entity="predef::.`^"/> + </section> <section title="Indexing"> @@ -554,6 +582,12 @@ arguments to a suitable range. This means that <li> No errors are generated in any of the above cases.</li> </ul> +<insert-move entity="predef::.`[]"/> +<insert-move entity="predef::.`->"/> +<insert-move entity="predef::.`[]="/> +<insert-move entity="predef::.`->="/> +<insert-move entity="predef::.`[--]"/> + </section> <!-- FIXME: tell more about indexing and ranges --> @@ -775,5 +809,7 @@ look at some examples:</p> absolute value of a.</dd> </dl> +<insert-move entity="predef::.`()"/> + </section> </chapter> -- GitLab