Details of Icon Prefix Operations


+N : N -- compute positive

+N produces the numeric value of N.
See also: N1 + N2

-N : N -- compute negative

-N produces the negative of N.
See also: N1 - N2

~c1 : c2 -- compute cset complement

~c1 produces the cset complement of c1 with respect to &cset.

=s1 : s2 -- match string in scanning

=s1 is equivalent to tab(match(s1)).
See also: match(), tab(), and N1 = N2()

@C : x -- activate co-expression

@C produces the outcome of activating C.
See also: x @ C

^C1 : C2 -- create refreshed co-expression

^C1 produces a refreshed copy of C1.
See also: N1 ^ N2

*x : i -- compute size

*x produces the size of x.
See also: N1 * N2

?x1 : x2 -- produce random value

If x1 is an integer, ?x1 produces a number from a pseudo-random sequence. If x1 > 0, it produces an integer in range 1 to x1, inclusive. If x1 = 0, it produces a real number in range 0.0 to 1.0.

If x1 is a string, ?x1 produces a randomly selected one-character substring of x1 that is a variable if x1 is a variable.

If x1 is a list, table, or record, ?x1 produces a randomly selected element, which is a variable, from x1.

If x1 is a set, ?x1 produces a randomly selected member of x1.

See also: s ? expr

!x1 : x2, x3, ..., xn -- generate values

If x1 is a file, !x1 generates the remaining lines of x1.

If x1 is a string, !x1 generates the one-character substrings of x1, and produces variables if x1 is a variable.

If x1 is a list, table, or record, !x1 generates the elements, which are variables, of x1. For lists and records, the order of generation is from the beginning to the end, but for tables it is unpredictable.

If x1 is a set, !x1 generates the members of x1 in no predictable order.


/x : x -- check for null value

/x produces x if the value of x is the null value, but fails otherwise. It produces a variable if x is a variable.
See also: N1 / N2

\x : x -- check for non-null value

\x produces x if the value of x is not the null value, but fails otherwise. If produces a variable if x is a variable.
See also: expr \ i

.x : x -- dereference variable

.x produces the value of x.
See also: R.f