12.07.2015 Views

Programmer's Guide & Language Reference - Dyalog Limited

Programmer's Guide & Language Reference - Dyalog Limited

Programmer's Guide & Language Reference - Dyalog Limited

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

FunctionsChapter 1: Introduction 18A function is an operation which is performed on zero, one or two array argumentsand may produce an array result. Three forms are permitted:• NILADIC defined for no arguments• MONADIC defined for a right but not a left argument• DYADIC defined for a left and a right argumentThe number of arguments is referred to as its VALENCE.The name of a non-niladic function is AMBIVALENT; that is, it potentially representsboth a monadic and a dyadic function, though it might not be defined forboth. The usage in an expression is determined by syntactical context. If the usageis not defined an error results.Functions have long SCOPE on the right; that is, the right argument of the function isthe result of the entire expression to its right which must be an array. A dyadic functionhas short scope on the left; that is, the left argument of the function is the arrayimmediately to its left. Left scope may be extended by enclosing an expression inparentheses whence the result must be an array.For some functions, the explicit result is suppressed if it would otherwise be displayedon completion of evaluation of the expression. This applies on assignment toa variable name. It applies for certain system functions, and may also apply fordefined functions.Examples¯308¯3¯304210×5-2×42×45-810ׯ3(10×5)-2×4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!