Outer Product: Difference between revisions

Jump to navigation Jump to search
20 bytes added ,  12:59, 5 September 2021
no edit summary
m (Added header)
No edit summary
Line 2: Line 2:


=== Syntax ===
=== Syntax ===
By right, a [[monadic operator]] should be a monograph (i.e. consist of only one character), and the operand should be on the left. However, due to [[legacy reason]], the outer product operator is not only a [[diagraph]] denoted as <source lang=apl inline>∘.</source>, the operand also appears on the right instead.
By right, a [[monadic operator]] should be a single [[glyph]], and the operand should be on the left. However, for [[backwards compatibility|historical reasons]], the outer product operator is not only a [[bi-glyph]] denoted as <source lang=apl inline>∘.</source>, the operand also appears on the right instead.


Notably, this syntactical inconsistency is resolved in [[BQN]], where the outer product operator <source lang=bqn inline>⌜</source> abides with the usual operator syntax. Also note that it is called table in BQN.
Notably, this syntactical inconsistency is resolved in [[J]] and [[BQN]], where the outer product operator, called Table, and denoted <source lang=j inline>/</source> and <code>⌜</code> respectively, abide by the usual operator syntax.


=== Examples ===
=== Examples ===
Line 23: Line 23:
12 15 18
12 15 18


       ⍝ works for multi-dimensional array as well
       ⍝ works for multi-dimensional arrays as well
       y←2 3 ⍴ 'abcdef'
       y←2 3 ⍴ 'abcdef'
       x←2 2 ⍴ ⍳4
       x←2 2 ⍴ ⍳4

Navigation menu