trusted
69
edits
(→Examples: +simple dyadic (copied from APL syntax)) |
|||
Line 4: | Line 4: | ||
== Examples == | == Examples == | ||
[[Ambivalent function]] with an optional left argument, a conditional [[control structure]] and one local variable | Simple [[dyadic function]]: | ||
<source lang=apl> | |||
∇ r←l Tradfn r | |||
⍝ ...do something | |||
r←l r | |||
∇ | |||
</source> | |||
{{Works in|[[Dyalog APL]], [[APL2]], [[GNU APL]], [[NARS2000]]}} | |||
[[Ambivalent function]] with an optional left argument, a conditional [[control structure]] and one local variable: | |||
<source lang=apl> | <source lang=apl> | ||
∇ res←{left} AddMult2 right;local | ∇ res←{left} AddMult2 right;local | ||
Line 14: | Line 23: | ||
∇ | ∇ | ||
</source> | </source> | ||
{{Works in|[[Dyalog APL]]}} | |||
[[GNU APL]] allows functions and operators accept an axis argument:<ref>[https://www.gnu.org/software/apl/apl.html#Section-3_002e2 3.2 Axis argument in defined functions] – GNU APL Manual</ref> | [[GNU APL]] allows functions and operators accept an axis argument:<ref>[https://www.gnu.org/software/apl/apl.html#Section-3_002e2 3.2 Axis argument in defined functions] – GNU APL Manual</ref> | ||
Line 25: | Line 35: | ||
3 8 13 18 23 | 3 8 13 18 23 | ||
</source> | </source> | ||
{{Works in|[[GNU APL]]}} | |||
== Representations == | == Representations == |