Mix: Difference between revisions

Jump to navigation Jump to search
546 bytes added ,  20:42, 4 September 2021
→‎Examples: Use proper glyph when possible
(→‎Documentation: BQN link)
(→‎Examples: Use proper glyph when possible)
(3 intermediate revisions by 2 users not shown)
Line 39: Line 39:
| [[BQN]]                          || Merge    || <code>></code> || [[Shape]]          || {{No}}  || {{No}}
| [[BQN]]                          || Merge    || <code>></code> || [[Shape]]          || {{No}}  || {{No}}
|}
|}
== Examples ==
<source lang="apl">
      x ← (0 1 2) (3 4 5) (9 9)
      ⍴x ⍝ x is a nested array, i.e. array of array
3
      ↑x ⍝ note that on the third row, 0 is padded to the end so the matrix can be orthogonal (non-ragged)
0 1 2
3 4 5
9 9 0
      ⍴↑x ⍝ ↑x is a non-nested 2-d array
3 3
</source>
Example application, to find the longest common prefix:
<source lang="apl">
      lcp←{(+/∧\(∧/⊃=⊢)¨↓⍉↑⍵)↑⊃⍵}
      lcp 'flowers' 'flow' 'flip'
fl
      lcp 'choco' 'choky' 'chom'
cho   
</source>


== External links ==
== External links ==

Navigation menu