FORMAT: a regexp like "^word(args)" of "^word[\t ]descriptive_text abs(numeric) any(cset,string,i,j) bal(cset1,cset2,cset3,string,i,j) center(string1,i,string2) char(i) close(file) collect() copy(x) cset(x) delete(x1,x2) detab(string,i1,i2,...,in) display(i,file) entab(string,i1,i2,...,in) errorclear() exit(i) find(string1,string2,i,j) get(list) getenv(string) iand(i,j) icom(i) image(x) insert(x1,x2,x3) integer(x) ior(i,j) ixor(i,h) ishift(i,j) left(string1,i,string2) list(i,x) many(cset,string,i,j) map(string1,string2,string3) match(string1,string2,i,j) member(x1,x2) move(i) numeric(x) open(string1,string2) ord(string) pop(list) pos(i) proc(x) pull(list) push(list,x) put(list,x) read(file) reads(file,i) real(x) remove(string) rename(string1,string2) repl(string,i) reverse(string) right(string1,i,string2) runerr(i,x) save(string) seek(file,i) seq(i,j) set(list) sort(list) sort(table,i) stop(x1,x2,...,xn) string(x) system(string) tab(i) table(x) trim(string,cset) type(x) upto(cset,string,i,j) where(file) write(x1,x2,...,xn) writes(x1,x2,...,xn) CONTROL STRUCTURES/RESERVED WORDS break expr by i to j by k case expr of {...} create x default : expr do every expr1 do expr2; until expr1 do expr2; while expr1 do expr2 dynamic identifiers else if expr1 then expr2 else expr3 end every expr1 do expr2 fail global identifiers if expr1 then expr2 else expr3 initial expr link file1,file2,...filen local identifiers next not expr of case expr of {...} procedure identifier(identifiers) record identifiers(fields) repeat expr return expr static identifiers suspend expr then if expr1 then expr2 else expr3 to i to j by k until expr1 do expr2 while expr1 do expr2 | expr1 | expr2; |expr \ expr \ i ; \x produces x if x is not null, otherwise fails ?:= s ?:= x ? s ? x; ?x produces a random element of x, failing if x is empty INFIX OPERATIONS + n + m produces the sum of n and m; +n produces the numeric value of n - n - m produces the difference of n and m; -n produces the negative of n * n * m produces the product of n and m; *x produces the size of x / n / m produces n divided by m; /x produces x if x is null, or else fails % n % m produces the remainder of n divided by m ^ n ^ m produces n to the power of m; ^e produces a refreshed copy of e < n < m produces m if n is less than m, else fails <= n <= m produces m if n is less than or equal to m, else fails = n = m produces m if n equals m, else fails; =s equiv. to tab(match(s)) >= n >= m produces m if n is greater than or equal to m, else fails > n > m produces m if n is greater than m, else fails ~= n ~= m produces m if n is not equal to m, else fails ++ c1 ++ c2 produces the cset union of c1 and c2 -- c1 -- c2 produces the cset difference of c1 and c2 ** c1 ** c2 produces the cset intersection of c1 and c2 || s1 || s2 produces a string consisting of s1 followed by s2 << s1 << s2 produces s2 if s1 is lexically less than s2, else fails <<= s1 <<= s2 produces s2 if s1 is lexically <= s2, else fails == s1 == s2 produces s2 if s1 is lexically equal to s2, else fails >>= s1 >>= s2 produces s2 if s1 is lexically >= s2, else fails >> s1 >> s2 produces s2 if s1 is lexically greater than s2, else fails ~== s1 ~== s2 produces s2 if s2 isn't lexically equal to s2, else fails ||| a1 ||| a2 produces a list of the values of a1 followed by those of a2 @ x @ e activates e and transmits x to it; @e produces the outcome of activating e := x := y assigns the value of y to x, and produces the variable x <- x <- y assigns y to x and produces x; reverses assignment if resumed :=: x :=: y exchanges the values of x and y and produces the variable x <-> x <-> y exchanges x and y and produces x; reverses exchange if resumed === x === y produces y if x and y have the same value, else fails ~=== x ~=== y produces y if x and y don't have the same value, else fails & x & y produces y; produces a variable if y is a variable . x . y produces a variable for the y field of record x +:= n +:= m assigns the sum of n and m to n and produces n -:= n -:= m assigns the difference of n and m to n and produces n *:= n *:= m assigns the product of n and m to n and produces n /:= n /:= m assigns the difference of n and m to n and produces n %:= n %:= m assigns the remainder of n divided by m to n and produces n ^:= n ^:= m assigns n raised to the power m to n and produces n <:= n <:= m assigns m to n if n < m, else fails; produces n <=:= n <=:= m assigns m to n if n <= m, else fails; produces n =:= n =:= m assigns m to n if n = m, else fails; produces n >=:= n >=:= m assigns m to n if n >= m, else fails; produces n >:= n >:= m assigns m to n if n > m, else fails; produces n ~=:= n ~=:= m assigns m to n if n ~= m, else fails; produces n ++:= c1 ++:= c2 assigns the cset union of c1 and c2 to c1 and produces c1 --:= c1 --:= c2 assigns the cset difference of c1 and c2 to c1, producing c1 **:= c1 **:= c2 assigns the intersection of c1 and c2 to c1, producing c1 ||:= s1 ||:= s2 assigns the string s1 || s2 to s1 and produces s1 <<:= s1 <:= s2 assigns s2 to s1 if s1 << s2, else fails; produces s1 <<=:= s1 <=:= s2 assigns s2 to s1 if s1 <<= s2, else fails; produces s1 ==:= s1 =:= s2 assigns s2 to s1 if s1 == s2, else fails; produces s1 >>=:= s1 >=:= s2 assigns s2 to s1 if s1 >>= s2, else fails; produces s1 >>:= s1 >:= s2 assigns s2 to s1 if s1 >> s2, else fails; produces s1 ~==:= s1 ~=:= s2 assigns s2 to s1 if s1 ~== s2, else fails; produces s1 |||:= a1 |||:= a2 assigns to a1 the concatenation of a1 and a2; produces a1 @:= x @:= e activates e with the value of x, and assigns the result to x ===:= x ===:= y assigns y to x if x === y, else fails; produces x ~===:= x ~===:= y assigns y to x if x ~=== y, else fails; produces x &:= x &:= y assigns the value of y to x and produces x PREFIX OPERATIONS (some under infix instead) ~ ~c produces the cset complement of c with respect to &cset ! !x generates the elements of x, failing if x is empty (x may be a file) . .x produces the value of x KEYWORDS &ascii produces a cset of the 128 ASCII characters &clock produces a string consisting of the current time of day &collections &cset produces a cset consisting of all 256 characters ¤t &date produces a string consisting of the current date &dateline produces a string of the current date and time of day &digits &error &errornumber &errortext &errorvalue &errout produces the standard error output file &fail fails &features &file &host produces a string that identifies the host computer &input produces the standard input file &lcase produces a cset consisting of the 26 lowercase letters &level produces the integer level of the current procedure call &line &main produces a co-expression for the initial call of main &null produces the null value &output produces the standard output file &pos produces the integer position of scanning in &subject &random produces the value of the seed for the psuedo-random sequence ®ions &source produces a co-expression for the activator of the current co-expression &storage how much of each storage region is currently being used &subject produces the variable whose value is the string being scanned &time produces the integer number of msecs since beginning of execution &trace produces a variable whose value controls procedure tracing &ucase produces a cset consisting of the 26 uppercase characters &version produces a string that identifies the version of Icon