Link: Difference between revisions

Jump to navigation Jump to search
496 bytes added ,  13:54, 16 June 2020
(Created page with "{{Built-in|Link|⊃}}, or <source lang=j inline>;</source> in J, is a dyadic primitive function which builds a nested vector out of the two argument|argu...")
 
Line 26: Line 26:
└─────────┴───┘
└─────────┴───┘
</source>{{Works in|[[SHARP APL]]}}
</source>{{Works in|[[SHARP APL]]}}
Similarly, the chaining fails if the rightmost array is already nested:
<source lang=apl>
      1 2⊃3 4⊃<5 6
┌───┬───┬───┐
│1 2│3 4│5 6│
└───┴───┴───┘
</source>{{Works in|[[SHARP APL]]}}
What we really wanted was:
<source lang=apl>
┌───┬───┬─────┐
│1 2│3 4│┌───┐│
│  │  ││5 6││
│  │  │└───┘│
└───┴───┴─────┘
</source>


Link is different from [[Pair]] <source lang=apl inline>⍮</source>, as Pair simply encloses both arguments and always produces a length-2 vector, so it cannot be used to construct a long nested array of uniform depth like Link does.
Link is different from [[Pair]] <source lang=apl inline>⍮</source>, as Pair simply encloses both arguments and always produces a length-2 vector, so it cannot be used to construct a long nested array of uniform depth like Link does.

Navigation menu