В алфавите языка APL около 70 спецсимволов!

Примеры программ

life{↑1 .3 4=+/,¯1 0 1.¯1 0 1.⌽⊂}

Игра Жизнь

(~RR.×R)/R1ιR

Все простые число от 1 до R

 

Monadic functions[edit]

Name(s)

Notation

Meaning

Roll

?B

One integer selected randomly from the first B integers

Ceiling

B

Least integer greater than or equal to B

Floor

B

Greatest integer less than or equal to B

ShapeRho

B

Number of components in each dimension of B

NotTilde

B

Logical: 1 is 0, 0 is 1

Absolute value

B

Magnitude of B

Index generatorIota

B

Vector of the first B integers

Exponential

B

e to the B power

Negation

−B

Changes sign of B

Identity

+B

No change to B

Signum

×B

¯1 if B<0; 0 if B=0; 1 if B>0

Reciprocal

÷B

1 divided by B

Ravel, Catenate, Laminate

,B

Reshapes B into a vector

Matrix inverse, Monadic Quad Divide

B

Inverse of matrix B

Pi times

○B

Multiply by π

Logarithm

B

Natural logarithm of B

Reversal

B

Reverse elements of B along last axis

Reversal

B

Reverse elements of B along first axis

Grade up

B

Indices of B which will arrange B in ascending order

Grade down

B

Indices of B which will arrange B in descending order

Execute

B

Execute an APL expression

Monadic format

B

A character representation of B

Monadic transpose

B

Reverse the axes of B

Factorial

!B

Product of integers 1 to B

Dyadic functions[edit]

Name(s)

Notation

Meaning

Add

A+B

Sum of A and B

Subtract

A−B

A minus B

Multiply

A×B

A multiplied by B

Divide

A÷B

A divided by B

Exponentiation

AB

A raised to the B power

Circle

A○B

Trigonometric functions of B selected by A

A=1: sin(B)    A=5: sinh(B)

A=2: cos(B)    A=6: cosh(B)

A=3: tan(B)    A=7: tanh(B)

Negatives produce the inverse of the respective functions

Deal

A?B

A distinct integers selected randomly from the first B integers

Membership, Epsilon

AB

1 for elements of A present in B; 0 where not.

Maximum, Ceiling

AB

The greater value of A or B

Minimum, Floor

AB

The smaller value of A or B

Reshape, Dyadic Rho

AB

Array of shape A with data B

Take

A↑B

Select the first (or last) A elements of B according to ×A

Drop

A↓B

Remove the first (or last) A elements of B according to ×A

Decode

AB

Value of a polynomial whose coefficients are B at A

Encode

AB

Base-A representation of the value of B

Residue

AB

B modulo A

Catenation

A,B

Elements of B appended to the elements of A

Expansion, Dyadic Backslash

A\B

Insert zeros (or blanks) in B corresponding to zeros in A

Compression, Dyadic Slash

A/B

Select elements in B corresponding to ones in A

Index of, Dyadic Iota

AB

The location (index) of B in A1+A if not found

Matrix divide, Dyadic Quad Divide

AB

Solution to system of linear equationsmultiple regression Ax = B

Rotation

AB

The elements of B are rotated A positions

Rotation

AB

The elements of B are rotated A positions along the first axis

Logarithm

AB

Logarithm of B to base A

Dyadic format

AB

Format B into a character matrix according to A

General transpose

AB

The axes of B are ordered by A

Combinations

A!B

Number of combinations of B taken A at a time

Diaeresis, Dieresis, Double-Dot

A¨B

Over each, or perform each separately; B = on these; A = operation to perform or using(e.g. iota)

Less than

A<B

Comparison: 1 if true, 0 if false

Less than or equal

A≤B

Comparison: 1 if true, 0 if false

Equal

A=B

Comparison: 1 if true, 0 if false

Greater than or equal

A≥B

Comparison: 1 if true, 0 if false

Greater than

A>B

Comparison: 1 if true, 0 if false

Not equal

A≠B

Comparison: 1 if true, 0 if false

Or

AB

Boolean Logic: 0(False) if both A and B = 0, 1 otherwise. Alt: 1(True) if A or B = 1(True)

And

AB

Boolean Logic: 1(True) if both A and B = 1, 0(False) otherwise

Nor

AB

Boolean Logic: 1 if both A and B are 0, otherwise 0. Alt: ~ = not Or

Nand

AB

Boolean Logic: 0 if both A and B are 1, otherwise 1. Alt: ~ = not And

Operators and axis indicator[edit]

Name(s)

Symbol

Example

Meaning (of example)

Reduce (last axis), Slash

/

+/B

Sum across B

Reduce (first axis)

+B

Sum down B

Scan (last axis), Backslash

\

+\B

Running sum across B

Scan (first axis)

+B

Running sum down B

Inner product

.

A+.×B

Matrix product of A and B

Outer product

.

AB

Outer product of A and B