Defined function (traditional): Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(→Basics) |
||
Line 19: | Line 19: | ||
</source> | </source> | ||
{{Works in|[[Dyalog APL]], [[APL2]], [[GNU APL]], [[NARS2000]], [[APLX]], and every older APL from [[APL\360]]}} | {{Works in|[[Dyalog APL]], [[APL2]], [[GNU APL]], [[NARS2000]], [[APLX]], and every older APL from [[APL\360]]}} | ||
=== Semi-colons === | |||
Assignments are global by default. To keep a name local, it must be mentioned in the header, separated from the rest of the header by a semi-colon: | |||
<source lang=apl> | |||
∇ r←l Tradfn r;intermediate | |||
intermediate←l r | |||
r←intermediate intermediate | |||
∇ | |||
</source> | |||
{{Works in|[[Dyalog APL]], [[APL2]], [[GNU APL]], [[NARS2000]], [[APLX]], and every older APL from [[APL\360]]}} | |||
=== Braces === | === Braces === | ||
An [[ambivalent function]] with an optional left argument, a conditional [[control structure]], one local variable, and a [[#Shyness|shy]] result: | An [[ambivalent function]] with an optional left argument, a conditional [[control structure]], one local variable, and a [[#Shyness|shy]] result: |