# Difference between revisions of "Dyadic operator"

(Created page with "In APL syntax, a '''dyadic operator''' is an operator which takes two operands, one on each side. In APL\360 the only dyadic operator was Inner Product, bu...") |
(Also called conjunction) |
||

Line 1: | Line 1: | ||

− | In [[APL syntax]], a '''dyadic operator''' is an [[operator]] which takes two [[operand]]s, one on each side. In [[APL\360]] the only dyadic operator was [[Inner Product]], but other operators such as [[Power (operator)|Power]] and [[Compose]] have become common, and languages such as [[J]], [[NARS2000]], and [[dzaima/APL]] have added many experimental dyadic operators. | + | In [[APL syntax]], a '''dyadic operator''' (or '''conjunction''') is an [[operator]] which takes two [[operand]]s, one on each side. In [[APL\360]] the only dyadic operator was [[Inner Product]], but other operators such as [[Power (operator)|Power]] and [[Compose]] have become common, and languages such as [[J]], [[NARS2000]], and [[dzaima/APL]] have added many experimental dyadic operators. |

The term "dyadic operator" refers to the [[operator valence|valence]] of the operator itself, that is, the number of operands. When applied, it produces a [[derived function]], which can have a different [[function valence]]. For example, the [[Inner Product]] is usually a dyadic operator that produces a [[dyadic function]] (<source lang=apl inline>+.× A</source> is a [[SYNTAX ERROR]], unless it's defined to be the [[Determinant]] operator), while [[Power (operator)|Power]] generally produces an [[ambivalent]] function. The [[Compose]] function can produce an ambivalent function <source lang=apl inline>f∘g</source>, or a monadic function <source lang=apl inline>A∘f</source> if an array <source lang=apl inline>A</source> is [[Bind|bound]] to a function <source lang=apl inline>f</source>. | The term "dyadic operator" refers to the [[operator valence|valence]] of the operator itself, that is, the number of operands. When applied, it produces a [[derived function]], which can have a different [[function valence]]. For example, the [[Inner Product]] is usually a dyadic operator that produces a [[dyadic function]] (<source lang=apl inline>+.× A</source> is a [[SYNTAX ERROR]], unless it's defined to be the [[Determinant]] operator), while [[Power (operator)|Power]] generally produces an [[ambivalent]] function. The [[Compose]] function can produce an ambivalent function <source lang=apl inline>f∘g</source>, or a monadic function <source lang=apl inline>A∘f</source> if an array <source lang=apl inline>A</source> is [[Bind|bound]] to a function <source lang=apl inline>f</source>. | ||

{{APL syntax}} | {{APL syntax}} |

## Latest revision as of 13:11, 24 March 2020

In APL syntax, a **dyadic operator** (or **conjunction**) is an operator which takes two operands, one on each side. In APL\360 the only dyadic operator was Inner Product, but other operators such as Power and Compose have become common, and languages such as J, NARS2000, and dzaima/APL have added many experimental dyadic operators.

The term "dyadic operator" refers to the valence of the operator itself, that is, the number of operands. When applied, it produces a derived function, which can have a different function valence. For example, the Inner Product is usually a dyadic operator that produces a dyadic function (`+.× A`

is a SYNTAX ERROR, unless it's defined to be the Determinant operator), while Power generally produces an ambivalent function. The Compose function can produce an ambivalent function `f∘g`

, or a monadic function `A∘f`

if an array `A`

is bound to a function `f`

.

APL syntax [edit]
| |
---|---|

General | Comparison with traditional mathematics ∙ Precedence ∙ Tacit programming |

Array | Numeric literal ∙ String ∙ Strand notation ∙ Object literal ∙ Array notation |

Function | Argument ∙ Function valence ∙ Derived function ∙ Niladic function ∙ Monadic function ∙ Dyadic function ∙ Ambivalent function ∙ Tradfn ∙ Dfn ∙ Derived function ∙ Function train |

Operator | Operand ∙ Operator valence ∙ Tradop ∙ Dop ∙ Derived operator |

Assignment | Multiple ∙ Indexed ∙ Selective ∙ Modified |

Other | Function axis ∙ Branching ∙ System command ∙ User command ∙ Keyword ∙ Dot notation |