<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Basic operators</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>Recent changes to Basic operators</description><atom:link href="https://sourceforge.net/p/cjam/wiki/Basic%20operators/feed" rel="self"/><language>en</language><lastBuildDate>Wed, 01 Jun 2016 16:11:07 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/cjam/wiki/Basic%20operators/feed" rel="self" type="application/rss+xml"/><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v82
+++ v83
@@ -834,11 +834,9 @@
 **Arity:** 0 • **Syntax:** `l`
 Reads a line from the input, not including the newline character, and pushes it as a string on the stack. If the end of input is reached, it returns a string containing a single newline (to avoid ambiguity).

-**Example input:**
-    foo bar
-    baz
-**Result:**
-    "foo bar"
+Example input      | Result
+-------------------|------------
+`foo bar`&lt;br/&gt;`baz` | `"foo bar"`

 &lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
 ##`m`
@@ -888,12 +886,9 @@
 **Arity:** 0 • **Syntax:** `q`
 Reads the whole input (until EOF) and pushes it as a string on the stack. If some of the input has already been read, it reads the rest of the input. If the whole input has already been read, it returns the empty string.

-**Example input:**
-    foo bar
-    baz
-**Result:**
-    "foo bar
-    baz"
+Example input      | Result
+-------------------|---------------------
+`foo bar`&lt;br/&gt;`baz` | `"foo bar`&lt;br/&gt;`baz"`

 &lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
 ##`r`
@@ -903,11 +898,9 @@
 **Arity:** 0 • **Syntax:** `r`
 Reads the next token from the input (separated by any whitespace) and pushes it as a string on the stack. If the end of input is reached, it returns the empty string.

-**Example input:**
-    foo bar
-    baz
-**Result:**
-    "foo"
+Example input      | Result
+-------------------|--------
+`foo bar`&lt;br/&gt;`baz` | `"foo"`

 &lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
 ##`s`
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Wed, 01 Jun 2016 16:11:07 -0000</pubDate><guid>https://sourceforge.neta2d6b7733521676ff1ebe6d813f7bf691f5c6064</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v81
+++ v82
@@ -1001,3 +1001,33 @@
 ----------|-------|-------------------------------|----------------|----------
 non-block | block | Execute arg2 if arg1 is false | `5 1{)}`| | `5`
           |       |                               | `5[]{)}`| | `6`
+
+&lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
+## `~` (tilde)
+&lt;/div&gt;
+
+####1. Bitwise NOT
+**Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 ~`
+Calculates the binary complement of an integer.
+
+arg1    | Result | Example | Result
+--------|--------|---------|-------
+integer | ~arg1  | `5~`    | `-6`
+
+####2. Evaluate/execute
+**Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 ~`
+Executes a block, or a string or character parsed as a block.
+
+arg1           | Result                         | Example   | Result
+---------------|--------------------------------|-----------|------------
+block          | Evaluate/execute arg1          | `{1 2+}~` | `3`
+string or char | Evaluate/execute arg1 as block | `"5)"~`   | `6`
+               |                                | `'2`~     | `2`
+
+####3. Dump array
+**Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 ~`
+Dumps the elements of an array on the stack. Note that it doesn't work for strings, as it evaluates them instead. To dump the characters of a string, use `{}/` instead.
+
+arg1             | Result           | Example      | Result
+-----------------|------------------|--------------|----------
+non-string array | Contents of arg1 | `[1 2 "a"]~` | `1 2 "a"`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Mon, 28 Mar 2016 19:48:06 -0000</pubDate><guid>https://sourceforge.neta81c3e8d9c413ae3d0b68e4452253fc40eeaecbb</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v80
+++ v81
@@ -968,3 +968,36 @@
 arg1    | Result    | Example  | Result
 --------|-----------|----------|-------
 numeric | abs(arg1) | `-1.23z` | `1.23`
+
+&lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
+## `|` (pipe)
+&lt;/div&gt;
+
+####1. Bitwise OR
+**Arity:** 2 • **Notation:** postfix • **Syntax:** `arg1 arg2 |`
+Performs a bit-by-bit OR on two integers or an integer and a character (through its numeric code).
+
+arg1    | arg2    | Result                     | Example      | Result
+--------|---------|----------------------------|--------------|-------
+integer | integer | arg1 (bitwise) | arg2 | `7 11`| | `15`
+integer | char    | (char) (arg1 | arg2)  | `3'a`|  | `'c`
+char    | integer | (char) (arg1 | arg2)  | `'R67`| | `'S`
+
+####2. Set union
+**Arity:** 2 • **Notation:** postfix • **Syntax:** `arg1 arg2 |`
+Gets all the items that belong to either one of 2 given arrays/strings, or an array and a number or character (seen as a 1-element array), without duplicates. The order of first occurrence is preserved.
+
+arg1            | arg2            | Result                 | Example                | Result
+----------------|-----------------|------------------------|------------------------|------------
+array or string | array or string | Union of arg1 and arg2 | `"hello""world"`| | `"helowrd"`
+array or string | numeric or char | Union of arg1 and arg2 | `"hello"'x`|      | `"helox"`
+numeric or char | array or string | Union of arg1 and arg2 | `3[2 3 3 4]`|     | `[3 2 4]`
+
+####3. If-else
+**Arity:** 2 • **Notation:** postfix • **Syntax:** `arg1 arg2 |`
+Executes a block if a given value is false (zero or empty).
+
+arg1      | arg2  | Result                        | Example        | Result
+----------|-------|-------------------------------|----------------|----------
+non-block | block | Execute arg2 if arg1 is false | `5 1{)}`| | `5`
+          |       |                               | `5[]{)}`| | `6`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Thu, 24 Mar 2016 21:07:12 -0000</pubDate><guid>https://sourceforge.netae8c3f93d028cf191e2ccbdab5036cb675df8923</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v79
+++ v80
@@ -965,6 +965,6 @@
 **Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 z`
 Gets the absolute value of a number.

-arg1    | Result   | Example  | Result
---------|----------|----------|-------
-numeric | \|arg1\| | `-1.23z` | `1.23`
+arg1    | Result    | Example  | Result
+--------|-----------|----------|-------
+numeric | abs(arg1) | `-1.23z` | `1.23`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Mon, 14 Mar 2016 14:02:09 -0000</pubDate><guid>https://sourceforge.net3450bb7162b27d83daf040a287e51441511d81a2</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v78
+++ v79
@@ -945,3 +945,26 @@
 arg1  | arg2  | Result                   | Example     | Result
 ------|-------|--------------------------|-------------|----------
 block | block | while(arg1) execute arg2 | `3{_}{_(}w` | `3 2 1 0`
+
+&lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
+## `z`
+&lt;/div&gt;
+
+####1. Zip (transpose)
+**Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 z`
+Takes an array viewed as a 2-dimensional matrix (array of rows), and transposes rows with columns. In effect, it returns an array in which the k'th row is an array of all elements in the k'th column or the argument. Rows with different lengths are not truncated, 
+
+arg1            | Result          | Example           | Result
+----------------|-----------------|-------------------|--------------------
+array or string | arg1 transposed | `"hello"z`        | `["hello"]`
+                |                 | `[[1 2][3 4 5]]z` | `[[1 3] [2 4] [5]]`
+
+Note: in the first example, the string is viewed as a matrix of 5 single-character rows, so the result is one row containing the whole string.
+
+####2. Abs
+**Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 z`
+Gets the absolute value of a number.
+
+arg1    | Result   | Example  | Result
+--------|----------|----------|-------
+numeric | \|arg1\| | `-1.23z` | `1.23`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Mon, 14 Mar 2016 13:40:02 -0000</pubDate><guid>https://sourceforge.net7859842037717d80fe5e295f6fc1605705f10039</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v77
+++ v78
@@ -933,3 +933,15 @@
 ----------------|-----------------|----------|-----------------------------------|---------------|----------
 array or string | integer         | anything | modified arg1 (arg1\[arg2\]=arg3) | `[5 6 7]2 3t` | `[5 6 3]`
 integer         | array or string | anything | modified arg2 (arg2\[arg1\]=arg3) | `4"foo"'xt`   | `"fxo"`
+
+&lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
+##`w`
+&lt;/div&gt;
+
+####While loop
+**Arity:** 2 • **Notation:** postfix • **Syntax:** `arg1 arg2 w`
+Executes a block repeatedly while a condition (given by another block) is true. Similar to ["`g`"](Basic operators#g) except the condition is given separately and is checked at the beginning.
+
+arg1  | arg2  | Result                   | Example     | Result
+------|-------|--------------------------|-------------|----------
+block | block | while(arg1) execute arg2 | `3{_}{_(}w` | `3 2 1 0`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Tue, 08 Mar 2016 08:01:58 -0000</pubDate><guid>https://sourceforge.netc9c40f2d9754f8f2238a1e63099944f143e46d79</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v76
+++ v77
@@ -927,7 +927,7 @@

 ####Set array item
 **Arity:** 3 • **Notation:** postfix • **Syntax:** `arg1 arg2 arg3 t`
-Sets an array element at a given position. Just like ["`=`"](Basic operators#equals), the position wraps around.
+Sets an array element at a given position. Just like ["`=`"](Basic operators#2-get-array-item), the position wraps around.

 arg1            | arg2            | arg3     | Result                            | Example       | Result
 ----------------|-----------------|----------|-----------------------------------|---------------|----------
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Mon, 07 Mar 2016 15:28:03 -0000</pubDate><guid>https://sourceforge.net931b59b48d38660168c43403d5b3d3257e21d056</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v75
+++ v76
@@ -483,9 +483,9 @@

 arg1            | arg2            | Result       | Example        | Result
 ----------------|-----------------|--------------|----------------|----------
-array or string | numeric         | arg1\[arg2\] | `"test"2=`     | `'s`
+array or string | integer         | arg1\[arg2\] | `"test"2=`     | `'s`
                 |                 |              | `[1 3]5=`      | `3`
-numeric         | array or string | arg2\[arg1\] | `-3"test123"=` | `'1`
+integer         | array or string | arg2\[arg1\] | `-3"test123"=` | `'1`
                 |                 |              | `0[1 2 3]=`    | `1`

 ####3. Find value
@@ -920,3 +920,16 @@
 arg1     | Result                   | Example             | Result
 ---------|--------------------------|---------------------|--------------
 anything | arg1 converted to string | `["foo"1.23[4'5]]s` | `"foo1.2345"`
+
+&lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
+##`t`
+&lt;/div&gt;
+
+####Set array item
+**Arity:** 3 • **Notation:** postfix • **Syntax:** `arg1 arg2 arg3 t`
+Sets an array element at a given position. Just like ["`=`"](Basic operators#equals), the position wraps around.
+
+arg1            | arg2            | arg3     | Result                            | Example       | Result
+----------------|-----------------|----------|-----------------------------------|---------------|----------
+array or string | integer         | anything | modified arg1 (arg1\[arg2\]=arg3) | `[5 6 7]2 3t` | `[5 6 3]`
+integer         | array or string | anything | modified arg2 (arg2\[arg1\]=arg3) | `4"foo"'xt`   | `"fxo"`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Mon, 07 Mar 2016 15:26:51 -0000</pubDate><guid>https://sourceforge.net8a81e2c33af11a0d64c53011dc5f933b80d6b400</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v74
+++ v75
@@ -908,3 +908,15 @@
     baz
 **Result:**
     "foo"
+
+&lt;div style="color: #070; border-top: 1px solid #555; padding-top: 1em;"&gt;
+##`s`
+&lt;/div&gt;
+
+####Convert to string
+**Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 s`
+Converts a value to string. Arrays items are converted individually and then concatenated with no separator.
+
+arg1     | Result                   | Example             | Result
+---------|--------------------------|---------------------|--------------
+anything | arg1 converted to string | `["foo"1.23[4'5]]s` | `"foo1.2345"`
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Wed, 02 Mar 2016 10:51:41 -0000</pubDate><guid>https://sourceforge.net1ba1b442bedab13e9b2e14f67dcb08f1bc99bc7d</guid></item><item><title>Basic operators modified by aditsu</title><link>https://sourceforge.net/p/cjam/wiki/Basic%2520operators/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v73
+++ v74
@@ -628,7 +628,7 @@

 ####String representation
 **Arity:** 1 • **Notation:** postfix • **Syntax:** ``arg1 ` ``
-Gets the string representation of a value.
+Gets the string representation of a value, i.e. a string that evaluates to the given value.

 arg1     | Result                        | Example    | Result
 ---------|-------------------------------|------------|-----------
@@ -874,7 +874,7 @@

 ####Print string representation and newline
 **Arity:** 1 • **Notation:** postfix • **Syntax:** `arg1 p`
-Prints the string representation of a value (removing it from the stack) to the standard output, followed by a newline character.
+Prints the string representation of a value (removing it from the stack) to the standard output, followed by a newline character. It's the same as applying ["`` ` ``"](Basic operators#backtick) then printing the result and a newline.

 arg1     | Result                                           | Example             | Output
 ---------|--------------------------------------------------|---------------------|------------
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">aditsu</dc:creator><pubDate>Wed, 02 Mar 2016 10:46:40 -0000</pubDate><guid>https://sourceforge.netc604d9219557f4ef91bf1aabb7021522290138da</guid></item></channel></rss>