Variant: Difference between revisions

Jump to navigation Jump to search
50 bytes added ,  10:06, 4 June 2022
→‎History: Dyalog: variant can be applied to primitives
m (→‎Usage =: typo)
(→‎History: Dyalog: variant can be applied to primitives)
Line 7: Line 7:
Variant dates back all the way to [[Iverson notation]] where a subscript was used to indicate which [[index origin]] a [[primitive]] would operate under. This system was dropped in [[APL\360]]. Instead, the [[system command]] <source lang=apl inline>)ORIGIN</source> was provided for controlling the interpreter's global setting. This was then supplemented with a [[system variable]] to control the global state. Though this feature is still present in many APL systems, together with numerous other system variables for controlling other aspects of the system, for example [[comparison tolerance]], these global settings were recognised as an unfortunate design in that every programmer would be forced to set and localise every system variable that could affect the given code. Later, [[Ken Iverson]] envisioned a return to a per-invocation setting, similar to the original notation, but this time in the form of a dyadic operator that would customise [[primitive function]]s.
Variant dates back all the way to [[Iverson notation]] where a subscript was used to indicate which [[index origin]] a [[primitive]] would operate under. This system was dropped in [[APL\360]]. Instead, the [[system command]] <source lang=apl inline>)ORIGIN</source> was provided for controlling the interpreter's global setting. This was then supplemented with a [[system variable]] to control the global state. Though this feature is still present in many APL systems, together with numerous other system variables for controlling other aspects of the system, for example [[comparison tolerance]], these global settings were recognised as an unfortunate design in that every programmer would be forced to set and localise every system variable that could affect the given code. Later, [[Ken Iverson]] envisioned a return to a per-invocation setting, similar to the original notation, but this time in the form of a dyadic operator that would customise [[primitive function]]s.


Although [[SHARP APL]] didn't implement Iverson's idea, [[J]] did. Later [[Dyalog APL 13.0]] (2011) repurposed it as a way of providing auxilliary arguments to [[system functions]] and [[derived function|functions derived]] from [[system operators]], but not for primitives.
Although [[SHARP APL]] didn't implement Iverson's idea, [[J]] did. Later [[Dyalog APL 13.0]] (2011) repurposed it as a way of providing auxiliary arguments to [[primitive function|primitive]] and [[system function]]s, and [[derived function|functions derived]] from [[primitive operator|primitive]] and [[system operator]]s.


== Usage ==
== Usage ==
13

edits

Navigation menu