Details of Icon Infix Operations (part 1)


N1 + N2 : N3 -- compute sum

N1 + N2 produces the sum of N1 and N2.
See also: +N

N1 - N2 : N3 -- compute difference

N1 - N2 produces the difference of N1 and N2.
See also: -N

N1 * N2 : N3 -- compute product

N1 * N2 produces the product of N1 and N2.
See also: *N

N1 / N2 : N3 -- compute quotient

N1 / N2 produces the quotient of N1 and N2.
See also: /x

N1 % N2 : N3 -- compute remainder

N1 % N2 produces the remainder of N1 divided by N2. The sign of the result is the sign of N1.

N1 ^ N2 : N3 -- compute exponential

N1 ^ N2 produces N1 raised to the power N2.
See also: ^N, exp(), and sqrt(),

x1 ++ x2 : x3 -- compute cset or set union

x1 ++ x2 produces the cset or set union of x1 and x2.

x1 -- x2 : x3 -- compute cset or set difference

x1 -- x2 produces the cset or set difference of x1 and x2.

x1 ** x2 : x3 -- compute cset or set intersection

x1 ** x2 produces the cset or set intersection of x1 and x2.

s1 || s2 : s3 -- concatenate strings

s1 || s2 produces a string consisting of s1 followed by s2.
See also: L1 ||| L2

L1 ||| L2 : L3 -- concatenate lists

L1 ||| L2 produces a list consisting of the values in L1 followed by the values in L2.
See also: s1 || s2

R.f : x -- get field of record

R.f produces a variable for the f field of record R.
See also: .x

x1 @ C : x2 -- transmit value to co-expression

x1 @ C activates C, transmitting the value of x1 to it; it produces the outcome of activating C.
See also: @C

x1 & x2 : x2 -- evaluate in conjunction

x1 & x2 produces x2. It produces a variable if x2 is a variable.

N1 > N2 : N2 -- compare numerically

N1 > N2 produces N2 if N1 is numerically greater than N2, but fails otherwise.
See also: N1 >= N2, N1 = N2, N1 <= N2, N1 < N2, and N1 ~= N2

N1 >= N2 : N2 -- compare numerically

N1 >= N2 produces N2 if N1 is numerically greater than or equal to N2, but fails otherwise.
See also: N1 > N2, N1 = N2, N1 <= N2, N1 < N2, and N1 ~= N2

N1 = N2 : N2 -- compare numerically

N1 = N2 produces N2 if N1 is numerically equal to N2, but fails otherwise.
See also: N1 > N2, N1 >= N2, N1 <= N2, N1 < N2, and N1 ~= N2

N1 <= N2 : N2 -- compare numerically

N1 <= N2 produces N2 if N1 is numerically less than or equal to N2, but fails otherwise.
See also: N1 > N2, N1 >= N2, N1 = N2, N1 < N2, and N1 ~= N2

N1 < N2 : N2 -- compare numerically

N1 < N2 produces N2 if N1 is numerically less than N2, but fails otherwise.
See also: N1 > N2, N1 >= N2, N1 = N2, N1 <= N2, and N1 ~= N2

N1 ~= N2 : N2 -- compare numerically

N1 ~= N2 produces N2 if N1 is not numerically equal to N2, but fails otherwise.
See also: N1 > N2, N1 >= N2, N1 = N2, N1 <= N2, and N1 < N2

s1 >> s2 : s2 -- compare lexically

s1 >> s2 produces s2 if s1 is lexically greater than s2, but fails otherwise.
See also: s1 >>= s2, s1 == s2, s1 <<= s2, s1 << s2, and s1 ~== s2

s1 >>= s2 : s2 -- compare lexically

s1 >>= s2 produces s2 if s1 is lexically greater than or equal to s2, but fails otherwise.
See also: s1 >> s2, s1 == s2, s1 <<= s2, s1 << s2, and s1 ~== s2

s1 == s2 : s2 -- compare lexically

s1 == s2 produces s2 if s1 is lexically equal to s2, but fails otherwise.
See also: s1 >> s2, s1 >>= s2, s1 <<= s2, s1 << s2, and s1 ~== s2

s1 <<= s2 : s2 -- compare lexically

s1 <<= s2 produces s2 if s1 is lexically less than or equal to s2, but fails otherwise.
See also: s1 >> s2, s1 >>= s2, s1 == s2, s1 << s2, and s1 ~== s2

s1 << s2 : s2 -- compare lexically

s1 << s2 produces s2 if s1 is lexically less than s2, but fails otherwise.
See also: s1 >> s2, s1 >>= s2, s1 == s2, s1 <<= s2, and s1 ~== s2

s1 ~== s2 : s2 -- compare lexically

s1 ~== s2 produces s2 if s1 is not lexically equal to s2, but fails otherwise.
See also: s1 >> s2, s1 >>= s2, s1 == s2, s1 <<= s2, and s1 << s2

s1 === s2 : s2 -- compare values

x1 === x2 produces the value of x2 if x1 and x2 have the same value, but fails otherwise.
See also: x1 === x2

s1 === s2 : s2 -- compare values

x1 === x2 produces the value of x2 if x1 and x2 do not have the same value, but fails otherwise.
See also: x1 ~=== x2