Ambivalent function: Difference between revisions

Jump to navigation Jump to search
m
Text replacement - "help.dyalog.com/latest/#Language/Primitive%20Operators/" to "help.dyalog.com/latest/#Language/I%20Beam%20Functions/"
No edit summary
m (Text replacement - "help.dyalog.com/latest/#Language/Primitive%20Operators/" to "help.dyalog.com/latest/#Language/I%20Beam%20Functions/")
Line 5: Line 5:
=== Tradfns ===
=== Tradfns ===


In some APLs, for example [[APL*PLUS]], [[tradfn]]s that declare a left argument in the [[function header]] are always ambivalent, and the code needs to check whether a left argument was supplied by the left argument name's [[name class]]; <source lang=apl inline>0 ≠ ⎕NC 'leftArg'</source>. Other APLs, for example [[Dyalog APL]], will not allow calling such a function monadically, unless the header has curly braces around the left argument name to indicate that it is optional; <source lang=apl inline> result ← {leftArg} FnName rightArg</source>. Then too, they need to query the name class, or, unique for Dyalog APL, use a specialised ''Called Monadically'' [[I-beam]], <source lang=apl inline>900⌶⍬</source>.<ref>[[Dyalog APL]] Language Reference Guide > The I-Beam Operator > [http://help.dyalog.com/latest/#Language/Primitive%20Operators/Called%20Monadically.htm Called Monadically]</ref>
In some APLs, for example [[APL*PLUS]], [[tradfn]]s that declare a left argument in the [[function header]] are always ambivalent, and the code needs to check whether a left argument was supplied by the left argument name's [[name class]]; <source lang=apl inline>0 ≠ ⎕NC 'leftArg'</source>. Other APLs, for example [[Dyalog APL]], will not allow calling such a function monadically, unless the header has curly braces around the left argument name to indicate that it is optional; <source lang=apl inline> result ← {leftArg} FnName rightArg</source>. Then too, they need to query the name class, or, unique for Dyalog APL, use a specialised ''Called Monadically'' [[I-beam]], <source lang=apl inline>900⌶⍬</source>.<ref>[[Dyalog APL]] Language Reference Guide > The I-Beam Operator > [http://help.dyalog.com/latest/#Language/I%20Beam%20Functions/Called%20Monadically.htm Called Monadically]</ref>


=== Dfns ===
=== Dfns ===

Navigation menu