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.

Chapter 1: Introduction 22Defined OperatorsOperators may be defined with the system function ⎕FX, or with the function editor.A defined operator consists of a HEADER which identifies the syntax of the operator,and a BODY in which one or more APL statements are specified.A defined operator may have one or two operands; and its derived function may haveone or two arguments, and may or may not produce a result. The header syntaxdefines the operator name, its operand(s), the argument(s) to its derived function, andthe result (if any) of its derived function. The names of the operator and its operand(s)are separated from the name(s) of the argument(s) to its derived function by parentheses.Example∇ R←A(F AND G)B[1] R←(A F B)(A G B)∇The above example shows a dyadic operator called AND with two operands (F andG). The operator produces a derived function which takes two arguments (A and B),and produces a result (R).16 312 +AND÷ 4Operands passed to an operator may be either functions or arrays.12 (3 AND 5) 412 3 4 12 5 412 (× AND 5) 448 12 5 4

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

Saved successfully!

Ooh no, something went wrong!