Details of Icon Functions S through Z
Seeks to position i in f, but fails if the seek cannot be performed.
The first byte in the file is at position 1. seek(f,0) seeks to the
end of file f.
See also: where()
Generates an endless sequence of integers starting at i1 with
increments of i2.
Defaults:
i1 1
i2 1
See also: i1 to i2 by i3
Produces the serial number of x if it is a type that has one
but fails otherwise.
Produces a set whose members are the distinct values in the list L.
Default:
L []
Produces the sine of r1 given in radians.
See also: asin()
Produces a list containing values from X. If X is a list, record, or
set, sort(X,i) produces the values of X in sorted order. If X is a
table, sort(X,i) produces a list obtained by sorting the elements of X,
depending on the value of i. For i = 1 or 2, the list elements are
two-element lists of key/value pairs. For i = 3 or 4, the list elements
are alternating keys and values. Sorting is by keys for i odd, by value
for i even.
Default:
i 1
See also: sortf()
Produces a sorted list of the values in X. Sorting is primarily by
type and in most respects is the same as with sort(X,i). However,
among lists and among records, two structures are ordered by comparing
their ith fields. i can be negative but not zero. Two structures
having the equal ith fields are ordered as they would be in regular
sorting, but structures lacking an ith field appear before structures
having them.
Default:
i 1
See also: sort()
Produces the square root of r1.
See also: N1 ^ N2()
Terminates program execution with an error status after writing strings
x1,x2,...,xn. If xi is a file, subsequent output is to xi. Initial
output is to standard error output.
Default:
xi "" (empty string)
See also: exit() and write()
Produces a string resulting from converting x, but fails if the
conversion is not possible.
Calls the C library function system() to execute s and produces the
resulting integer exit status.
Produces &subject[&pos:i] and assigns i to &pos, but fails if i is out
of range. It reverses assignment to &pos if resumed.
See also: move()
Produces a table with a default value x.
Default:
x &null
Produces the tangent of r1 given in radians.
See also: atan()
Produces a string consisting of the characters of s1 up to the trailing
characters contained in c.
Default:
c ' ' (blank)
Produces a string corresponding to the type of x.
Generates the sequence of integer positions in s preceding a character
of c in s[i1:i2]. It fails if there is no such position.
Defaults:
s &subject
i1 &pos if s defaulted, otherwise 1
i2 0
See also: bal() and find()
Produces the variable for the identifier or keyword named s, but fails
if there is no such variable. Local identifiers override global
identifiers.
See also: name()
Produces the current byte position in f. The first byte in the file is
at position 1.
See also: seek()
Writes strings x1,x2,...,xn with a line termination sequence added at
the end. If xi is a file, subsequent output is to xi. Initial output
is to standard output.
Default:
xi "" (empty string)
See also: writes()
Writes strings x1,x2,...,xn without a line termination sequence added
at the end. If xi is a file, subsequent output is to xi. Initial
output is to standard output.
Default:
xi "" (empty string)
See also: write()