Replicate: Difference between revisions

Jump to navigation Jump to search
2,462 bytes added ,  13:33, 13 March 2020
Extension support
(→‎History: Version number for APL2 conformability in Dyalog)
(Extension support)
Line 64: Line 64:


[[A+]] and [[J]] modified Replicate to fit [[leading axis theory]]. Rather than allow Replicate to operate on any axis they have only one Replicate function (in A+, <source lang=apl inline>/</source>; in J, <source lang=j inline>#</source>) which works on the first axis—it copies [[major cell]]s rather than elements. Both languages rejected the [[NARS]] extension to negative left arguments, but J introduced its own system to add [[fill element]]s by allowing [[complex number]]s in the left argument, and removed the [[Expand]] function entirely. [[Arthur Whitney]] went on to make a more radical change in [[K]], removing Replicate entirely in favor of [[Where]].
[[A+]] and [[J]] modified Replicate to fit [[leading axis theory]]. Rather than allow Replicate to operate on any axis they have only one Replicate function (in A+, <source lang=apl inline>/</source>; in J, <source lang=j inline>#</source>) which works on the first axis—it copies [[major cell]]s rather than elements. Both languages rejected the [[NARS]] extension to negative left arguments, but J introduced its own system to add [[fill element]]s by allowing [[complex number]]s in the left argument, and removed the [[Expand]] function entirely. [[Arthur Whitney]] went on to make a more radical change in [[K]], removing Replicate entirely in favor of [[Where]].
== Extension support ==
Here ">1" refers to the [[SHARP APL]] extension to non-negative integers, while "<0" refers to extension to negative integers in either NARS or APL2 style.
{| class=wikitable
!rowspan=2| Language
!rowspan=2| Type
!rowspan=2 style="min-width:6em"| >1
!colspan=2| <0
!rowspan=2| Conformability<br/>extension
!rowspan=2| Axis<br/>specification
!rowspan=2| Notes
|-
! NARS !! APL2
|-
| [[APL\360]]                                        || Ambiguous || {{No}}  ||colspan=2 {{No}}    || {{Maybe|Single}}    || {{Yes}} ||
|-
| [[SHARP APL]]                                      || Operator  || {{Yes}} ||colspan=2 {{No}}    || {{No|Scalar}}      || {{Yes}} ||
|-
| [[NARS]]                                            || Function  || {{Yes}} || {{Yes}} || {{No}}  || {{Maybe|Single}}    || {{Yes}} ||
|-
| [[Dyalog APL]]                                      || Function  || {{Yes}} || {{Yes}} || {{No}}  || {{Yes|APL2 (13.1)}} || {{Yes}} ||
|-
| [[APL2]]                                            || Function  || {{Yes}} || {{No}}  || {{Yes}} || {{Yes|APL2}}        || {{Yes}} ||
|-
| [[A+]] (<source lang=apl inline>/</source>)        || Function  || {{Yes}} ||colspan=2 {{No}}    || {{Maybe|Single}}    || {{No}}  ||
|-
| [[J]] (<source lang=j inline>#</source>)            || Function  || {{Yes}} ||colspan=2 {{No}}    || {{No|Scalar}}      || {{No}}  || Complex left argument allowed
|-
| [[ISO/IEC 13751:2001]]                              || Function  || {{Yes}} ||colspan=2 {{No}}    || {{No|Scalar}}      || {{Yes}} ||
|-
| [[APLX]]                                            || Function  || {{Yes}} || {{Yes}} || {{Yes}} || {{Yes|APL2}}        || {{Yes}} ||
|-
| [[NARS2000]]                                        || Function  || {{Yes}} || {{Yes}} || {{No}}  || {{Maybe|Single}}    || {{Yes}} ||
|-
| [[ngn/apl]]                                        || Function  || {{Yes}} || {{Yes}} || {{No}}  || {{Yes|APL2}}        || {{Yes}} ||
|-
| [[GNU APL]]                                        || Function  || {{Yes}} || {{No}}  || {{Yes}} || {{Yes|APL2}}        || {{Yes}} ||
|-
| [[dzaima/APL]] (<source lang=apl inline>⌿</source>) || Function  || {{Yes}} || {{Yes}} || {{No}}  || {{None}}            || {{No}}  || Vector right argument only
|}
In each language without axis specification, there is only one form of Replicate, which always applies to the first axis or [[major cell]]s—the last-axis form is discarded.


== External Links ==
== External Links ==

Navigation menu