Uiua: Difference between revisions

Jump to navigation Jump to search
1,483 bytes added ,  28 January
no edit summary
No edit summary
No edit summary
Line 274: Line 274:
Keys <code>≤0</code> will be omitted.
Keys <code>≤0</code> will be omitted.
The function then processes each group in order. The result depends on what the function is.
The function then processes each group in order. The result depends on what the function is.
If the function takes 0 or 1 arguments, then <code>⊜ partition</code> behaves like ≡ rows. This is called iterating <code>⊜ partition.</code>
If the function takes 0 or 1 arguments, then <code>⊜ partition</code> behaves like <code>≡ rows</code>. This is called iterating <code>⊜ partition.</code>
|}
|}
==== Inversion Modifiers ====
==== Inversion Modifiers ====
Line 307: Line 307:
| <code>∘</code> || [[Identity]] || Monadic function || Do nothing with one value
| <code>∘</code> || [[Identity]] || Monadic function || Do nothing with one value
|-
|-
|  
| <code>⋅</code> || [[Gap]] || Monadic modifier || Discard the top stack value then call a function
|-
| <code>⊙</code> || [[Dip]] || Monadic modifier || Temporarily pop the top value off the stack and call a function
|-
| <code>∩</code> || [[Both]] || Monadic 2-argument modifier || Call a function on two sets of values
For monadic functions, <code>∩ both</code> calls its function on each of the top 2 values on the stack.
|-
| <code>⊃</code> || [[Fork]] || Dyadic modifier || Call two functions on the same values
<code>⊃ fork</code> is one of the most important functions for working with the stack.
|-
| <code>⪾</code> || <span style="color:black; background-color: yellow">🧪[[Cascade]] || Dyadic modifier || 🧪Call one function after another, reusing some values
<code>⪾ cascade</code>'s second function is called, then its first argument(s) are reused, along with its output, as arguments to the first function.
|-
| <code>⊓</code> || [[Bracket]] || Dyadic modifier || Call two functions on two distinct sets of values
|-
| <code>⋔</code> || 🧪[[All]] || Dyadic modifier || 🧪Call a function on many distinct sets of values
For just 2 sets of values, <code>∩ both</code> is often simpler.
 
The second function will be called, then the first function will be called on groups of values.
To do something similar to ∩ both on more than 2 sets of values, you can use <code>⊙ dip</code> and <code>∘</code> identity to select values.
|}
|}
== External links ==
== External links ==
19

edits

Navigation menu