trusted
69
edits
m (Text replacement - "http://help.dyalog.com" to "https://help.dyalog.com") |
|||
Line 4: | Line 4: | ||
== Examples == | == Examples == | ||
[[Ambivalent function]] with optional left argument and one local variable (Dyalog APL): | [[Ambivalent function]] with an optional left argument, a conditional [[control structure]] and one local variable (Dyalog APL): | ||
<source lang=apl> | <source lang=apl> | ||
∇ res←{left} AddMult2 right;local | ∇ res←{left} AddMult2 right;local | ||
:If 0=⎕NC'left' | :If 0=⎕NC'left' ⍝ if variable "left" is not defined already | ||
left←0 | |||
:EndIf | :EndIf | ||
local←left+right | local←left+right |