home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 200-299 / ff277.lzh / Icon / version7.doc < prev    next >
Text File  |  1989-11-16  |  44KB  |  1,793 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.                       Version 7.5 of Icon*
  15.  
  16.  
  17.                         Ralph E. Griswold
  18.                         Gregg M. Townsend
  19.                          Kenneth Walker
  20.  
  21.  
  22.  
  23.                             TR 88-41
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.                         December 15, 1988
  50.  
  51.  
  52.                  Department of Computer Science
  53.  
  54.                     The University of Arizona
  55.  
  56.                       Tucson, Arizona 85721
  57.  
  58.  
  59.  
  60.  
  61. *This work was supported by the National Science Foundation under
  62. Grant DCR-8401831.
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.                        Version 7.5 of Icon
  77.  
  78.  
  79.  
  80.  
  81. 1.  Background
  82.  
  83.    The current version of Icon is Version 7.5, which is a minor
  84. revision of Version 7.0.  Version 7.5 contains a number of
  85. features not present in earlier versions, but otherwise is nearly
  86. the same as Version 5.  The Icon book [1], which describes Ver-
  87. sion 5, continues to serve as the primary reference for Version
  88. 7.5.  This report supplements the present Icon book.  Together,
  89. the book and this report provide a complete description of Ver-
  90. sion 7.5.
  91.  
  92.    Most of the language extensions in Version 7.5 are upward-
  93. compatible with Version, 5 and almost all Version 5 and Version 6
  94. Icon programs work properly under Version 7.5.  However, some of
  95. the more implementation-dependent aspects described in the Ver-
  96. sion 5 book are now obsolete. See Section 3.  The differences
  97. between Version 7.0 and 7.5 are so minor that most users will not
  98. detect them.
  99.  
  100.  
  101. 2.  Features of Version 7.5
  102.  
  103.    The major differences between Version 7.5 and Version 5 are
  104. listed below.  Features that are new since Version 6 are identi-
  105. fied by hollow squares ([]).  Features that are new since Version
  106. 7.0 are identified by hollow circles (O).  In some cases these
  107. designations are not precise, since there are many interactions
  108. between features in different versions; they are intended only to
  109. focus attention.
  110.  
  111.         A declaration to allow the inclusion of separately
  112.         translated Icon programs.
  113.  
  114.         A set data type.
  115.  
  116.         New options for sorting tables.
  117.  
  118.         Syntax to support the use of co-expressions in
  119.         programmer-defined control operations.
  120.  
  121.         The invocation of functions and operators by their string
  122.         names.
  123.  
  124.      [] New functions, especially for interfacing the operating
  125.         system and manipulating bits.
  126.  
  127.  
  128.  
  129.  
  130.                              - 1 -
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.      [] Correction of the handling of scanning environments.
  140.  
  141.      [] Correction of the handling of co-expression return points
  142.         and new co-expression facilities.
  143.  
  144.      [] Declaration of procedures with a variable number of argu-
  145.         ments.
  146.  
  147.      [] The ability to convert potential run-time errors to
  148.         expression failure.
  149.  
  150.      [] New keywords.
  151.  
  152.      [] Error traceback, which provides detailed information
  153.         about the source of run-time errors.
  154.  
  155. 2.1  O Command-Line Options
  156.  
  157.    Options to icont must precede file names on the command line.
  158. For example,
  159.  
  160.         icont -o manager proto.icn
  161.  
  162. not
  163.  
  164.         icont proto.icn -o manager
  165.  
  166. The position of options has always been documented this way, but
  167. it was not enforced previously. Consequently, options in the
  168. incorrect position that worked before will not work now. This
  169. problem is most likely to occur in scripts that were composed
  170. under earlier version of Icon.
  171.  
  172.    Note that the -x option is an exception; it must occur after
  173. all file names for icont, since any command-line arguments after
  174. -x apply to execution (iconx).
  175.  
  176. 2.2  The Link Declaration
  177.  
  178.    The link declaration simplifies the inclusion of separately
  179. translated libraries of Icon procedures. If icont [2] is run with
  180. the -c option, source files are translated into intermediate
  181. ucode files (with names ending in .u1 and .u2).  For example,
  182.  
  183.         icont -c libe.icn
  184.  
  185. produces the ucode files libe.u1 and libe.u2. The ucode files can
  186. be incorporated in another program with the new link declaration,
  187. which has the form
  188.  
  189.         link libe
  190.  
  191. The argument of link is, in general, a list of identifiers or
  192. string literals that specify the names of files to be linked
  193.  
  194.  
  195.  
  196.                              - 2 -
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205. (without the .u1 or .u2). Thus, when running under UNIX*,
  206.  
  207.         link libe, "/usr/icon/ilib/collate"
  208.  
  209. specifies the linking of libe in the current directory and col-
  210. late in /usr/icon/ilib.  The syntax for paths may be different
  211. for other operating systems.
  212.  
  213.    The environment variable IPATH controls the location of files
  214. specified in link declarations. The value of IPATH should be a
  215. blank-separated string of the form p1 p2  ... pn where each pi
  216. names a directory.  Each directory is searched in turn to locate
  217. files named in link declarations. The default value of IPATH is
  218. the current directory. The current directory is always searched
  219. first, regardless of the value of IPATH.
  220.  
  221. 2.3  New Functions
  222.  
  223.    Most of the new functions are described in this section. See
  224. subsequent sections for functions specifically related to other
  225. new features.  Note: Some implementations have additional func-
  226. tions. These are described in user manuals.
  227.  
  228.  [] System-Interface Functions
  229.  
  230. getenv(s)
  231.  
  232.    getenv(s) produces the value of the environment variable s. It
  233. fails if the environment variable is not set. It also fails on
  234. systems that do not support environment variables.
  235.  
  236. remove(s)
  237.  
  238.    remove(s) removes the file named s. Subsequent attempts to
  239. open the file fail, unless it is created anew. If the file is
  240. open, the behavior of remove(s) is system dependent. remove(s)
  241. fails if it is unsuccessful.
  242.  
  243. rename(s1,s2)
  244.  
  245.    rename(s1,s2) causes the file named s1 to be henceforth known
  246. by the name s2.  The file named s1 is effectively removed. If a
  247. file named s2 exists prior to the renaming, the behavior is sys-
  248. tem dependent.  rename(s1,s2) fails if unsuccessful, in which
  249. case if the file existed previously it is still known by its ori-
  250. ginal name. Among the other possible causes of failure would be a
  251. file currently open, or a necessity to copy the file's contents
  252. to rename it.
  253.  
  254.  
  255.  
  256.                           
  257. *UNIX is a trademark of AT&T Bell Laboratories.
  258.  
  259.  
  260.  
  261.  
  262.                              - 3 -
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271. seek(f,i)
  272.  
  273.    seek(f,i) seeks to position i in file f.  As with other posi-
  274. tions in Icon, a nonpositive value of i can be used to reference
  275. a position relative to the end of f.  i defaults to 1.  seek(f,i)
  276. returns f but fails if an error occurs.
  277.  
  278. where(f)
  279.  
  280.    where(f) returns the current byte position in the file f.
  281.  
  282.  [] Characters and Ordinals
  283.  
  284. char(i)
  285.  
  286.    char(i) produces a string containing the character whose
  287. internal representation, or ordinal, is the integer i. i must be
  288. between 0 and 255 inclusive.  If i is out of range, or not con-
  289. vertible to integer, a run-time error occurs.
  290.  
  291. ord(s)
  292.  
  293.    ord(s) produces an integer between 0 and 255 representing the
  294. ordinal, or internal representation, of a character. If s is not
  295. convertible to string, or if the string's length is not 1, a
  296. run-time error occurs.
  297.  
  298.  [] Tab Expansion and Insertion
  299.  
  300. detab(s,i1,i2,...,in)
  301.  
  302.    detab(s,i1,i2,...,in) replaces each tab character in s by one
  303. or more space characters, using tab stops at i1,i2...,in, and
  304. then additional tab stops created by repeating the last interval
  305. as necessary. The default is detab(s,9).
  306.  
  307.    Tab stops must be positive and strictly increasing. There is
  308. an implicit tab stop at position 1 to establish the first inter-
  309. val. Examples:
  310.  
  311. detab(s)             tab stops at 9, 17, 25, 33, ...
  312. detab(s,5)           tab stops at 5, 9, 13, 17, ...
  313. detab(s,8,12)        tab stops at 8, 12, 16, 20, ...
  314. detab(s,11,18,30,36) tab stops at 11, 18, 30, 36, 42, 48, ...
  315.  
  316. For purposes of tab processing, "\b" has a width of -1, and "\r"
  317. and "\n" restart the counting of positions. Other nonprinting
  318. characters have zero width, and printing characters have a width
  319. of 1.
  320.  
  321. entab(s,i1,i2,...,in)
  322.  
  323.    entab(s,i1,i2,...,in) replaces runs of consecutive spaces with
  324. tab characters.  Tab stops are specified in the same manner as
  325.  
  326.  
  327.  
  328.                              - 4 -
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. for the detab function. Any existing tab characters in s are
  338. preserved, and other nonprinting characters are treated identi-
  339. cally with the detab function.  The default is entab(s,9).
  340.  
  341.    A lone space is never replaced by a tab character;  however, a
  342. tab character may replace a single space character that is part
  343. of a longer run.
  344.  
  345.  [] Bit-Wise Functions
  346.  
  347.    The following functions operate on the individual bits compos-
  348. ing one or two integers. All produce an integer result.
  349.  
  350. iand(i,j)   produces the bit-wise and of i and j
  351. ior(i,j)    produces the bit-wise inclusive or of i and j
  352. ixor(i,j)   produces the bit-wise exclusive or of i and j
  353. icom(i)     produces the bit-wise complement (one's complement) of i
  354. ishift(i,j) If j is positive, produces i shifted left by j bit positions.
  355.             If j is negative, produces i shifted right by -j bit positions.
  356.             If j is zero, produces i.
  357.             In all cases, vacated bit positions are filled with zeroes.
  358.  
  359.  
  360.  [] Executable Images
  361.  
  362. save(s)
  363.  
  364.    The function save(s) saves an executable image of an executing
  365. Icon program in the file named s. This function presently is
  366. implemented only on 4.nbsd UNIX systems. See Section 2.11 for a
  367. method of determining if this feature is implemented.
  368.  
  369.    save can be called from any point in a program. It accepts a
  370. single argument that names the file that is to receive the
  371. resulting executable.  The named file is created if it does not
  372. exist. Any output problems on the file cause save to fail. For
  373. lack of anything better, save returns the number of bytes in the
  374. data region.
  375.  
  376.    When the new executable is run, execution of the Icon program
  377. begins in the main procedure. Global and static variables have
  378. the value they had when save was called, but all dynamic local
  379. variables have the null value. Any initial clauses that have been
  380. executed are not re-executed.  As usual, arguments present on the
  381. command line are passed to the main procedure as a list.  Command
  382. line input and output redirections are processed normally, but
  383. any files that were open are no longer open and attempts to read
  384. or write them will fail.
  385.  
  386.    When the Icon interpreter starts up, it examines a number of
  387. environment variables to determine various operational parame-
  388. ters. When a saved executable starts up, the environment vari-
  389. ables are not examined; the parameter values recorded in the exe-
  390. cutable are used instead.  Note that many of the parameter values
  391.  
  392.  
  393.  
  394.                              - 5 -
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403. are dynamic and may have changed considerably from values sup-
  404. plied initially.
  405.  
  406.    Consider an example:
  407.  
  408.         global hello
  409.         procedure main()
  410.            initial {
  411.               hello := "Hello World!"
  412.               save("hello") | stop("Error saving to 'hello'")
  413.               exit()
  414.               }
  415.            write(hello)
  416.         end
  417.  
  418.  
  419.    The global variable hello is assigned "Hello World!" and then
  420. the interpreter is saved to the file hello. The program then
  421. exits.  When hello is run, main's initial clause is skipped since
  422. it has already been executed. The variable hello has retained its
  423. value and the call to write produces the expected greeting.
  424.  
  425.    It is possible to call save any number of times during the
  426. course of execution. Saving to the same file each time is rather
  427. uninteresting, but imagine a complex data structure that passes
  428. through levels of refinement and then saving out a series of exe-
  429. cutables that capture the state of the structure at given times.
  430.  
  431.    Saved executables contain the entire data space present at the
  432. time of the save and thus can be quite large. Saved executables
  433. on the VAX are typically around 250k bytes.
  434.  
  435. Integer Sequences
  436.  
  437.    seq(i,j) generates an infinite sequence of integers starting
  438. at i with increments of j. An omitted or null-valued argument
  439. defaults to 1. For example, seq() generates 1, 2, 3, ... .
  440.  
  441. 2.4  Structures
  442.  
  443. Sets
  444.  
  445.    Sets are unordered collections of values and have many of the
  446. properties normally associated with sets in the mathematical
  447. sense.  The function
  448.  
  449.         set(a)
  450.  
  451. creates a set that contains the distinct elements of the list a.
  452. For example,
  453.  
  454.         set(["abc",3])
  455.  
  456. creates a set with two members, abc and 3.
  457.  
  458.  
  459.  
  460.                              - 6 -
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.    [] The default value for an omitted argument to set is an
  470. empty list.  Consequently,
  471.  
  472.         set()
  473.  
  474. creates an empty set.
  475.  
  476.    Sets, like other data aggregates in Icon, need not be homo-
  477. geneous - a set may contain members of different types.
  478.  
  479.    Sets, like other Icon data aggregates, are represented by
  480. pointers to the actual data. Sets can be members of sets, as in
  481.  
  482.         s1 := set([1,2,3])
  483.         s2 := set([s1,[]])
  484.  
  485. in which s2 contains two members, one of which is a set of three
  486. members and the other of which is an empty list.
  487.  
  488.    Any specific value can occur only once in a set. For example,
  489.  
  490.         set([1,2,3,3,1])
  491.  
  492. creates a set with the three members 1, 2, and 3.  Set membership
  493. is determined the same way the equivalence of values is deter-
  494. mined in the operation
  495.  
  496.         x === y
  497.  
  498. For example,
  499.  
  500.         set([[],[]])
  501.  
  502. creates a set that contains two distinct empty lists.
  503.  
  504.    Several set operations are provided. The function
  505.  
  506.         member(s,x)
  507.  
  508. succeeds and returns the value of x if x is a member of s, but
  509. fails otherwise. Note that
  510.  
  511.         member(s1,member(s2,x))
  512.  
  513. succeeds if x is a member of both s1 and s2.
  514.  
  515.    The function
  516.  
  517.         insert(s,x)
  518.  
  519. inserts x into the set s and returns the value of s.  Note that
  520. insert(s,x) is similar to put(a,x) in form.  A set may contain (a
  521. pointer to) itself:
  522.  
  523.  
  524.  
  525.  
  526.                              - 7 -
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.         insert(s,s)
  536.  
  537. adds s as an member of itself.
  538.  
  539.    The function
  540.  
  541.         delete(s,x)
  542.  
  543. deletes the member x from the set s and returns the value of s.
  544.  
  545.    The functions insert(s,x) and delete(s,x) always succeed,
  546. whether or not x is in s. This allows their use in loops in which
  547. failure may occur for other reasons. For example,
  548.  
  549.         s := set()
  550.         while insert(s,read())
  551.  
  552. builds a set that consists of the (distinct) lines from the stan-
  553. dard input file.
  554.  
  555.    The operations
  556.  
  557.         s1 ++ s2
  558.         s1 ** s2
  559.         s1 -- s2
  560.  
  561. create the union, intersection, and difference of s1 and s2,
  562. respectively. In each case, the result is a new set.
  563.  
  564.    The use of these operations on csets is unchanged. There is no
  565. automatic type conversion between csets and sets; the result of
  566. the operation depends on the types of the arguments. For example,
  567.  
  568.         'aeiou' ++ 'abcde'
  569.  
  570. produces the cset 'abcdeiou', while
  571.  
  572.         set([1,2,3]) ++ set([2,3,4])
  573.  
  574. produces a set that contains 1, 2, 3, and 4. On the other hand,
  575.  
  576.         set([1,2,3]) ++ 4
  577.  
  578. results in Run-time Error 119 (set expected).
  579.  
  580.    The functions and operations of Icon that apply to other data
  581. aggregates apply to sets as well. For example, if s is a set,
  582.  
  583.         *s
  584.  
  585. is the size of s (the number of members in it). Similarly,
  586.  
  587.         type(s)
  588.  
  589.  
  590.  
  591.  
  592.                              - 8 -
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601. produces the string set.  The string images of sets are in the
  602. same style as for other aggregates, with the size enclosed in
  603. parentheses. Therefore,
  604.  
  605.         s := set(["abc",3])
  606.         write(image(s))
  607.  
  608. writes set(2).
  609.  
  610.    The operation
  611.  
  612.         !s
  613.  
  614. generates the members of s, but in no predictable order. Simi-
  615. larly,
  616.  
  617.         ?s
  618.  
  619. produces a randomly selected member of s.  These operations pro-
  620. duce values, not variables - it is not possible to assign a value
  621. to !s or ?s.
  622.  
  623.    The function
  624.  
  625.         copy(s)
  626.  
  627. produces a new set, distinct from s, but which contains the same
  628. members as s. The copy is made in the same fashion as the copy of
  629. a list - the members themselves are not copied.
  630.  
  631.    The function
  632.  
  633.         sort(s)
  634.  
  635. produces a list containing the members of s in sorted order.
  636. Sets occur after tables but before records in Icon's collating
  637. sequence.
  638.  
  639. Examples
  640.  
  641. Word Counting:
  642.  
  643.    The following program lists, in alphabetical order, all the
  644. different words that occur in standard input:
  645.  
  646.         procedure main()
  647.            letter := &lcase ++ &ucase
  648.            words := set()
  649.            while text := read() do
  650.               text ? while tab(upto(letter)) do
  651.                  insert(words,tab(many(letter)))
  652.            every write(!sort(words))
  653.         end
  654.  
  655.  
  656.  
  657.  
  658.                              - 9 -
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667. The Sieve of Eratosthenes:
  668.  
  669.    The follow program produces prime numbers, using the classical
  670. ``Sieve of Eratosthenes'':
  671.  
  672.         procedure main()
  673.            local limit, s, i
  674.            limit := 5000
  675.            s := set()
  676.            every insert(s,1 to limit)
  677.            every member(s,i := 2 to limit) do
  678.               every delete(s,i + i to limit by i)
  679.            primes := sort(s)
  680.            write("There are ",*primes," primes in the first ",limit," integers.")
  681.            write("The primes are:")
  682.            every write(right(!primes,*limit + 1))
  683.         end
  684.  
  685.  
  686.  [] Tables
  687.  
  688.    The functions member, insert, and delete apply to tables as
  689. well as sets.
  690.  
  691.    The function member(t,x) succeeds if x is an entry value (key)
  692. in the table t, but fails otherwise.
  693.  
  694.    The function insert(t,x,y) inserts the entry value x into
  695. table t with the assigned value y. If there already was an entry
  696. value x in t, its assigned value is changed.  Note that insert
  697. has three arguments when used with tables, as compared to two
  698. when used with sets. An omitted third argument defaults to the
  699. null value.
  700.  
  701.    The function delete(t,x) removes the entry value x and its
  702. corresponding assigned value from t. If x is not an entry value
  703. in t, no operation is performed; delete succeeds in either case.
  704.  
  705.  [] Sorting Order for Elements of Lists and Tables
  706.  
  707.    A complete ordering is now defined for structures (lists,
  708. sets, tables, and records) and csets that appear in a larger
  709. structure to be sorted.  Different types are still kept separate,
  710. but within each structure type, elements are now sorted chrono-
  711. logically (in the order they were created). All of the different
  712. record types are sorted together.  Csets are sorted lexically, in
  713. the same fashion as strings.
  714.  
  715. Sorting Options for Tables
  716.  
  717.    Two new options are available for sorting tables. These
  718. options are specified by the values 3 and 4 as the second argu-
  719. ment of sort(t,i).  Both of these options produce a single list
  720. in which the entry values and assigned values of table elements
  721.  
  722.  
  723.  
  724.                              - 10 -
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733. alternate. A value of 3 for i produces a list in which the entry
  734. values are in sorted order, and a value of 4 produces a list in
  735. which the assigned values are in sorted order. For example, if
  736. the table wcount contains elements whose entry values are words
  737. and whose corresponding assigned values are counts, the following
  738. code segment writes out a list of the words and their counts,
  739. with the words in alphabetical order:
  740.  
  741.         a := sort(wcount,3)
  742.         every i := 1 to *a - 1 by 2 do
  743.            write(a[i]," : ",a[i + 1])
  744.  
  745.  
  746.    The main advantage of the new sorting options is that they
  747. only produce a single list, rather than a list of lists as pro-
  748. duced by the options 1 and 2. The amount of space needed for the
  749. single list is proportionally much less than for the list of
  750. lists.
  751.  
  752. 2.5  Programmer-Defined Control Operations
  753.  
  754.    As described in [3], co-expressions can be used to provide
  755. programmer-defined control operations. Version 7.5 provides sup-
  756. port for this facility by means of an alternative syntax for pro-
  757. cedure invocation in which the arguments are passed in a list of
  758. co-expressions. This syntax uses braces in place of parentheses:
  759.  
  760.         p{expr1, expr2, ..., exprn}
  761.  
  762. is equivalent to
  763.  
  764.         p([create expr1, create expr2, ..., create exprn])
  765.  
  766. Note that
  767.  
  768.         p{}
  769.  
  770. is equivalent to
  771.  
  772.         p([])
  773.  
  774.  
  775. 2.6  Invocation By String Name
  776.  
  777.    A string-valued expression that corresponds to the name of a
  778. procedure or operation can be used in place of the procedure or
  779. operation in an invocation expression. For example,
  780.  
  781.         "image"(x)
  782.  
  783. produces the same call as
  784.  
  785.         image(x)
  786.  
  787.  
  788.  
  789.  
  790.                              - 11 -
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799. and
  800.  
  801.         "-"(i,j)
  802.  
  803. is equivalent to
  804.  
  805.         i - j
  806.  
  807.  
  808.    In the case of operator symbols with unary and binary forms,
  809. the number of arguments determines the operation. Thus
  810.  
  811.         "-"(i)
  812.  
  813. is equivalent to
  814.  
  815.         -i
  816.  
  817. Since to-by is an operation, despite its reserved-word syntax, it
  818. is included in this facility with the string name "..." .  Thus
  819.  
  820.         "..."(1,10,2)
  821.  
  822. is equivalent to
  823.  
  824.         1 to 10 by 2
  825.  
  826. Similarly, range specifications are represented by ":", so that
  827.  
  828.         ":"(s,i,j)
  829.  
  830. is equivalent to
  831.  
  832.         s[i:j]
  833.  
  834. The subscripting operation is available with the string name
  835. "[]". Thus
  836.  
  837.         "[]"(&lcase,3)
  838.  
  839. produces c.
  840.  
  841.    Defaults are not provided for omitted or null-valued arguments
  842. in this facility. Consequently,
  843.  
  844.         "..."(1,10)
  845.  
  846. results in a run-time error when it is evaluated.
  847.  
  848.    Arguments to operators invoked by string names are derefer-
  849. enced. Consequently, string invocation for assignment operations
  850. is ineffective and results in error termination.
  851.  
  852.    String names are available for the operations in Icon, but not
  853.  
  854.  
  855.  
  856.                              - 12 -
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865. for control structures. Thus
  866.  
  867.         "|"(expr1,expr2)
  868.  
  869. is erroneous.  Note that string scanning is a control structure.
  870.  
  871.    Field references, of the form
  872.  
  873.         expr . fieldname
  874.  
  875. are not operations in the ordinary sense and are not available
  876. via string invocation.  In addition, conjunction is not available
  877. via string invocation, since no operation is actually performed.
  878.  
  879.    String names for procedures are available through global iden-
  880. tifiers.  Note that the names of functions, such as image, are
  881. global identifiers. Similarly, any procedure-valued global iden-
  882. tifier may be used as the string name of a procedure. Thus in
  883.  
  884.         global q
  885.  
  886.         procedure main()
  887.            q := p
  888.            "q"("hi")
  889.         end
  890.  
  891.         procedure p(s)
  892.            write(s)
  893.         end
  894.  
  895. the procedure p is invoked via the global identifier q.
  896.  
  897.    The function proc(x,i) converts x to a procedure, if possible.
  898. If x is procedure-valued, its value is returned unchanged. If the
  899. value of x is a string that corresponds to the name of a pro-
  900. cedure as described in the preceding section, the corresponding
  901. procedure value is returned.  The value of i is used to distin-
  902. guish between unary and binary operators.  For example,
  903. proc("*",2) produces the multiplication operator, while
  904. proc("*",1) produces the size operator.  The default value for i
  905. is 1.  If x cannot be converted to a procedure, proc(x,i) fails.
  906.  
  907. 2.7   [] String Scanning
  908.  
  909.    Scanning environments (&subject and &pos) are now maintained
  910. correctly.  In particular, they are are now restored when a scan-
  911. ning expression is exited via break, next, return, fail, and
  912. suspend. This really is a correction of a bug, although the
  913. former handling of scanning environments is described as a
  914. `feature' in the Icon book. Note also that this change could
  915. affect the behavior of existing Icon programs.
  916.  
  917.  
  918.  
  919.  
  920.  
  921.  
  922.                              - 13 -
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931. 2.8   [] Procedures with a Variable Number of Arguments
  932.  
  933.    A procedure can be made to accept a variable number of argu-
  934. ments by appending [] to the last (or only) parameter in the
  935. parameter list.  An example is:
  936.  
  937.         procedure p(a,b,c[])
  938.           suspend a + b + !c
  939.         end
  940.  
  941.  
  942. If called as p(1,2,3,4,5), the parameters have the following
  943. values:
  944.  
  945.         a    1
  946.         b    2
  947.         c    [3,4,5]
  948.  
  949.  
  950.    The last parameter always contains a list. This list consists
  951. of the arguments not used by the previous parameters. If the pre-
  952. vious parameters use up all the arguments, the list is empty. If
  953. there are not enough arguments to satisfy the previous parame-
  954. ters, the null value will be used for the remaining ones, but the
  955. last parameter will still contain the empty list.
  956.  
  957.    The following procedure, which models the function write, but
  958. keeps a count of the number of arguments written, illustrates a
  959. use of this feature:
  960.  
  961.         global wcount
  962.  
  963.  
  964.         procedure Write(a[])
  965.            initial wcount := 0
  966.            wcount +:= *a
  967.            every writes(!a)
  968.            write()
  969.         end
  970.  
  971.  
  972. 2.9   [] Co-Expressions
  973.  
  974.    Co-expression return points are now handled properly, so that
  975. co-expressions can be used as coroutines.
  976.  
  977.    The image of a co-expression now includes an identifying
  978. number. Numbers start with 1 for &main and increase as new co-
  979. expressions are created.
  980.  
  981.    Co-expression activation and return are now traced along with
  982. procedure calls and returns if &trace is nonzero. Co-expression
  983. tracing shows the identifying numbers.
  984.  
  985.  
  986.  
  987.  
  988.                              - 14 -
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.    There is a new keyword, ¤t, the current co-expression.
  998.  
  999.    O The initial size of &main is now 1, instead of 0, to reflect
  1000. its activation to start program execution.
  1001.  
  1002.    O An attempt to refresh &main results in a run-time error.
  1003. (Formerly, it caused a memory violation.)
  1004.  
  1005. 2.10   [] Input and Output
  1006.  
  1007.    There no longer are any length limitations on the string pro-
  1008. duced by read() or reads(), nor on the length of the argument to
  1009. system() or the first argument of open().
  1010.  
  1011.    Formerly the value returned by write(x1,x2,...,xn) and
  1012. writes(x1,x2,...,xn) was the last written argument converted to a
  1013. string. The conversion is no longer performed. For example, the
  1014. value returned by write(1) is the integer 1.
  1015.  
  1016.    Errors during writing (such as inadequate space on the output
  1017. device) now cause error termination.
  1018.  
  1019.    The function read(f) reads the last line of the file f, even
  1020. if that line does not end with a newline (Version 5 discarded
  1021. such a line).
  1022.  
  1023.    If the file f is open as a pipe, close(f) returns the system
  1024. code resulting from closing f instead of f.
  1025.  
  1026.    Icon no longer performs its own I/O buffering; instead, this
  1027. function is left to the operating system on which Icon runs. The
  1028. environment variable NBUFS is no longer supported.
  1029.  
  1030. 2.11  Errors
  1031.  
  1032.  [] Error Traceback
  1033.  
  1034.    A run-time error now shows a traceback, giving the sequence of
  1035. procedure calls to the site of the error, followed by a symbolic
  1036. rendering of the offending expression.  For example, suppose the
  1037. following program is contained in the file max.icn:
  1038.  
  1039.         procedure main()
  1040.            i := max("a",1)
  1041.         end
  1042.  
  1043.  
  1044.         procedure max(i,j)
  1045.            if i > j then i else j
  1046.         end
  1047.  
  1048. Its execution in Version 7.5 produces the following output:
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                              - 15 -
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.         Run-time error 102
  1064.         File max.icn; Line 6
  1065.         numeric expected
  1066.         offending value: "a"
  1067.         Traceback:
  1068.            main()
  1069.            max("a",1) from line 2 in max.icn
  1070.            {"a" > 1} from line 6 in max.icn
  1071.  
  1072.  
  1073.  [] Error Conversion
  1074.  
  1075.    A new keyword, &error, is provided to allow users to convert
  1076. most run-time errors into expression failure. It behaves like
  1077. &trace: if it is zero, the default value, errors are handled as
  1078. usual. If it is non-zero, errors are treated as failure and
  1079. &error is decremented.
  1080.  
  1081.    There are a few errors that cannot be converted to failure:
  1082. arithmetic overflow and underflow, stack overflow, and errors
  1083. during program initialization.
  1084.  
  1085.    When an error is converted to failure in this way, three key-
  1086. words are set:
  1087.  
  1088.      +  &errornumber is the number of the error (e.g., 101).
  1089.         Reference to &errornumber fails if there has not been an
  1090.         error.
  1091.  
  1092.      +  &errortext is the error message (e.g., integer expected).
  1093.  
  1094.      +  &errorvalue is the offending value. Reference to &error-
  1095.         value fails if there is no specific offending value.
  1096.  
  1097. The function errorclear() removes the indication of the last
  1098. error. Subsequent references to &errornumber fail until another
  1099. error occurs.
  1100.  
  1101.    A use of these keywords is illustrated by the following pro-
  1102. cedure, which could be used to process potential run-time errors
  1103. that had been converted to failure:
  1104.  
  1105.         procedure ErrorCheck()
  1106.            write("\nError ",&errornumber)
  1107.            write(&errortext)
  1108.            write("offending value: ",image(&errorvalue))
  1109.            writes("\nDo you want to continue? (n)")
  1110.            if map(read()) == ("y" | "yes") then return
  1111.            else exit()
  1112.         end
  1113.  
  1114.  
  1115. For example,
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                              - 16 -
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.            &error := -1
  1130.                .
  1131.                .
  1132.                .
  1133.            write(s) | ErrorCheck()
  1134.  
  1135. could be used to check for an error during writing, while
  1136.  
  1137.            (a := sort(t,3)) | ErrorCheck()
  1138.  
  1139. could be used to detect failure to sort a table into a list (for
  1140. lack of adequate storage).
  1141.  
  1142.    The function runerr(i,x) causes program execution to terminate
  1143. with error number i as if a corresponding run-time error had
  1144. occurred. If i is the number of a standard run-time error, the
  1145. corresponding error text is printed; otherwise no error text is
  1146. printed. The value of x is given as the offending value. If x is
  1147. omitted, no offending value is printed.
  1148.  
  1149.    This function is provided so that library procedures can be
  1150. written to terminate in the same fashion as built-in operations.
  1151. It is advisable to use error numbers for programmer-defined
  1152. errors that are well outside the range of numbers used by Icon
  1153. itself. See Appendix B. Error number 500 has the predefined text
  1154. program malfunction for use with runerr.  This number is not used
  1155. by Icon itself.
  1156.  
  1157.    A call of runerr is subject to conversion to failure like any
  1158. other run-time error.
  1159.  
  1160. 2.12   [] Implementation Features
  1161.  
  1162.    Since different implementations of Icon may support different
  1163. features and some installations may chose to provide a subset of
  1164. the full Version 7.5, the keyword &features has been provided to
  1165. provide such information. &features generates the features of the
  1166. implementation on which the current program is running. For exam-
  1167. ple, on a 4.nbsd UNIX implementation,
  1168.  
  1169.         every write(&features)
  1170.  
  1171. produces
  1172.  
  1173.         UNIX
  1174.         co-expressions
  1175.         overflow checking
  1176.         direct execution
  1177.         environment variables
  1178.         error traceback
  1179.         executable images
  1180.         string invocation
  1181.         expandable regions
  1182.  
  1183.  
  1184.  
  1185.  
  1186.                              - 17 -
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.    Similarly, a program that uses co-expressions can check for
  1196. the presence of this feature:
  1197.  
  1198.         if not(&features == "co-expressions") then runerr(-401)
  1199.  
  1200.  
  1201. 2.13   [] Storage Management
  1202.  
  1203.    Storage is allocated automatically during the execution of an
  1204. Icon program, and garbage collections are performed automatically
  1205. to reclaim storage for subsequent reallocation.  There are three
  1206. storage regions: static, string, and block.  Only implementations
  1207. in which regions can be expanded support a static region.  See
  1208. [4] for more information.
  1209.  
  1210.    An Icon programmer normally need not worry about storage
  1211. management.  However, in applications that require a large amount
  1212. of storage or that must operate in a limited amount of memory,
  1213. some knowledge of the storage management process may be useful.
  1214.  
  1215.    The keyword &collections generates four values associated with
  1216. garbage collection: the total number since program initiation,
  1217. the number triggered by static allocation, the number triggered
  1218. by string allocation, and the number triggered by block alloca-
  1219. tion.  The keyword ®ions generates the current sizes of the
  1220. static, string, and block regions.  The keyword &storage gen-
  1221. erates the current amount of space used in the static, string,
  1222. and block regions. The value given for the static region
  1223. presently is not meaningful.
  1224.  
  1225.    O Garbage collection is forced by the function collect(i,j).
  1226. The value of i specifies the region and the value of j specifies
  1227. the amount of space that must be free following the collection.
  1228. The regions are designated as follows:
  1229.  
  1230.         i    region
  1231.  
  1232.         1    static
  1233.         2    string
  1234.         3    block
  1235.  
  1236. The region specified is reflected in the values generated by
  1237. &collections.  A value of 0 for i causes a garbage collection
  1238. without a specific region. In this case, the value of j is
  1239. irrelevant.  The default values for i and j are 0.
  1240.  
  1241. 2.14  Version Checking
  1242.  
  1243.    The Icon translator converts a source-language program to an
  1244. intermediate form, called ucode. The Icon linker converts one or
  1245. more ucode files to a binary form called icode. The format of
  1246. Version 7.5 ucode and icode files is different from that of ear-
  1247. lier versions.  To avoid the possibility of malfunction due to
  1248. incompatible ucode and icode formats, Version 7.5 checks both
  1249.  
  1250.  
  1251.  
  1252.                              - 18 -
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261. ucode and icode files and terminates processing with an error
  1262. message if the versions are not correct.
  1263.  
  1264. 2.15  Odds and Ends
  1265.  
  1266.  [] Other Keywords
  1267.  
  1268.    In addition to the new keywords mentioned above, there are
  1269. three others:
  1270.  
  1271.      +  &digits, whose value is the cset '0123456789'.
  1272.  
  1273.      +  &line, the current source-code line number.
  1274.  
  1275.      +  &file, the current source-code file name.
  1276.  
  1277.  [] External Data Type
  1278.  
  1279.    There is a new data type, external, for use in extensions to
  1280. Icon that require the allocation of unstructured blocks of data.
  1281. This data type should not be visible in standard versions of
  1282. Icon.
  1283.  
  1284.  [] Addition to suspend
  1285.  
  1286.    The suspend control structure now has an optional do clause,
  1287. analogous to every-do. If a do clause is present in a suspend
  1288. control structure, its argument is evaluated after the suspend is
  1289. resumed and before possible suspension with another result.
  1290.  
  1291.    For example, the following expression might be used to count
  1292. the number of suspensions:
  1293.  
  1294.         suspend expr do count +:= 1
  1295.  
  1296.  
  1297. O String Images
  1298.  
  1299.    ``Unprintable'' characters in strings now are imaged with hex-
  1300. adecimal escape sequences rather than with octal ones.
  1301.  
  1302. O Display Output
  1303.  
  1304.    The function display(f,i) now prints the image of the current
  1305. co-expression before listing the values of variables.
  1306.  
  1307. O Tracing
  1308.  
  1309.    If the value of &trace is negative, it is decremented every
  1310. time a trace message is written. Previously it was left
  1311. unchanged. This change does not affect tracing itself, but it
  1312. does allow the number of trace messages that have been written to
  1313. be determined by a running program.
  1314.  
  1315.  
  1316.  
  1317.  
  1318.                              - 19 -
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  [] Linker Options
  1328.  
  1329.    The option to generate diagnostic (.ux) files during linking
  1330. has been changed from -D to -L.
  1331.  
  1332.    The amount of space needed to associate source-program line
  1333. numbers with executable code can be set by -Snn. The default
  1334. value of n is 1000.  Similarly, the amount of space needed to
  1335. associate file names with executable code can be set by -SFn. The
  1336. default is 10.
  1337.  
  1338.  [] Path to iconx
  1339.  
  1340.    For implementations that support direct execution of icode
  1341. files, the hardwired path to iconx is overridden by the value of
  1342. the environment variable ICONX, if it is set.
  1343.  
  1344. O Block Region Size
  1345.  
  1346.    The environment variable BLOCKSIZE is now a synonym for HEAP-
  1347. SIZE.
  1348.  
  1349.  [] File Names
  1350.  
  1351.    During translation and linking, the suffix .u is interpreted
  1352. as .u1, and no suffix is interpreted as .icn.
  1353.  
  1354.    On MS-DOS, VMS, and the Atari ST the icode file produced by
  1355. the linker now has the extension icx.  For example,
  1356.  
  1357.         icont prog.icn
  1358.  
  1359. produces an icode file named prog.icx. The extension need not be
  1360. given when using iconx:
  1361.  
  1362.         iconx prog
  1363.  
  1364. looks first for prog.icx; failing that it looks for prog.
  1365.  
  1366.  [] Redirection of Error Output
  1367.  
  1368.    The option -e now allows standard error output to be
  1369. redirected to a file. For example,
  1370.  
  1371.         iconx -e prog.err prog
  1372.  
  1373. executes prog and sends any error output to the file prog.err.
  1374. If - is given in place of a file name, error output is redirected
  1375. to standard output. On systems on which standard output can be
  1376. redirected to a file, -e - causes both error output and standard
  1377. output go to that file. For example,
  1378.  
  1379.         iconx -e - prog >prog.out
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                              - 20 -
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393. redirects both error output and standard output to prog.out.  The
  1394. use of - with -e is not available on the Atari ST or Macintosh.
  1395.  
  1396.  
  1397. 3.  Obsolete and Changed Features of Version 5
  1398.  
  1399.    The original implementation of Version 5 supported both a com-
  1400. piler (iconc) and an interpreter (icont).  Version 7.5 supports
  1401. only an interpreter. Interpretation is only slightly slower than
  1402. the execution of compiled code and the interpreter is portable
  1403. and gets into execution much more quickly than the compiler. How-
  1404. ever, it is not possible to load C functions with the interpreter
  1405. as it was with the compiler.  A system for personalized inter-
  1406. preters [5] is included with Version 7.5 for UNIX systems to make
  1407. it comparatively easy to add new functions and otherwise modify
  1408. the Icon run-time system.
  1409.  
  1410.    Some run-time environment variables have changed; see Appendix
  1411. A.  Several error messages have been changed.  Appendix B con-
  1412. tains a list of run-time error messages for Version 7.5.
  1413.  
  1414.  
  1415. 4.  Known Bugs in Version 7.5
  1416.  
  1417.  
  1418.      +  The text of some translator error messages is incorrect
  1419.         and may not correctly reflect the nature of errors.
  1420.  
  1421.      +  The translator does not detect arithmetic overflow in
  1422.         conversion of numeric literals. Very large numeric
  1423.         literals may have incorrect values.
  1424.  
  1425.      +  Integer overflow on multiplication and exponentiation may
  1426.         not be detected during execution.  Such overflow may
  1427.         occur during type conversion.
  1428.  
  1429.      +  Line numbers may be wrong in diagnostic messages related
  1430.         to lines with continued quoted literals.
  1431.  
  1432.      +  In some cases, trace messages may show the return of sub-
  1433.         scripted values, such as &null[2], that would be errone-
  1434.         ous if they were dereferenced.
  1435.  
  1436.      +  If a long file name for an Icon source-language program
  1437.         is truncated by the operating system, mysterious diagnos-
  1438.         tic messages may occur during linking.
  1439.  
  1440.      +  Stack overflow is checked using a heuristic that may not
  1441.         always be effective.
  1442.  
  1443.      +  If an expression such as
  1444.  
  1445.                 x := create expr
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                              - 21 -
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.         is used in a loop, and x is not a global variable,
  1460.         unreferenceable co-expressions are generated by each suc-
  1461.         cessive create operation.  These co-expressions are not
  1462.         garbage collected.  This problem can be circumvented by
  1463.         making x a global variable or by assigning a value to x
  1464.         before the create operation, as in
  1465.  
  1466.                 x := &null
  1467.                 x := create expr
  1468.  
  1469.  
  1470.      +  Stack overflow in a co-expression may not be detected and
  1471.         may cause mysterious program malfunction.
  1472.  
  1473.  
  1474. 5.  Possible Differences Among Version 7.5 Implementations
  1475.  
  1476.    A few aspects of the implementation of Version 7.5 are
  1477. specific to different computer architectures and operating sys-
  1478. tems. Co-expressions require a context switch that is implemented
  1479. in assembly language.  If this context switch is not implemented,
  1480. an attempt to activate a co-expression results in error termina-
  1481. tion.  Arithmetic overflow checking also generally requires
  1482. assembly-language routines and may not be supported on some
  1483. implementations of Version 7.5.
  1484.  
  1485.    Some features of Icon, such as opening a pipe for I/O and the
  1486. system function, are not supported on all operating systems.
  1487.  
  1488. Acknowledgements
  1489.  
  1490.    In addition to the authors of this report, Dave Gudeman and
  1491. Bill Mitchell made significant contributions to Version 7.5 of
  1492. Icon.
  1493.  
  1494. References
  1495.  
  1496. 1.  Griswold, Ralph E. and Madge T. Griswold. The Icon Program-
  1497. ming Language, Prentice-Hall, Inc., Englewood Cliffs, New Jersey.
  1498. 1983.
  1499.  
  1500. 2.  Griswold, Ralph E. ICONT(1), manual page for UNIX
  1501. Programmer's Manual, Department of Computer Science, The Univer-
  1502. sity of Arizona. 1988.
  1503.  
  1504. 3.  Griswold, Ralph E. and Michael Novak. ``Programmer-Defined
  1505. Control Operations'', The Computer Journal, Vol. 26, No. 2 (May
  1506. 1983).
  1507.  
  1508. 4.  Griswold, Ralph E. and Madge T. Griswold.  The Implementation
  1509. of the Icon Programming Language, Princeton University Press,
  1510. Princeton, New Jersey. 1987.
  1511.  
  1512. 5.  Griswold, Ralph E. Personalized Interpreters for Version 7.5
  1513.  
  1514.  
  1515.  
  1516.                              - 22 -
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525. of Icon, Technical Report TR 88-7a, Department of Computer Sci-
  1526. ence, The University of Arizona. 1988.
  1527.  
  1528.  
  1529.  
  1530.  
  1531.  
  1532.  
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                              - 23 -
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.                Appendix A - Environment Variables
  1592.  
  1593.  
  1594.  
  1595.  
  1596.    There are a number of environment variables that can be set to
  1597. override the default values for sizes of Icon's storage regions
  1598. and other run-time parameters.  Except for ICONX, NOERRBUF, and
  1599. ICONCORE, the values assigned to these environment variables must
  1600. be numbers.  Default values for regions vary from system to sys-
  1601. tem and are given in user manuals.  Some implementations also
  1602. have other environment variables.
  1603.  
  1604.    The environment variables are:
  1605.  
  1606.      ICONX     If set, this environment variable is used for the
  1607.                location of iconx used to execute an icode file.
  1608.  
  1609.      TRACE     Specifies the initial value of &trace. The default
  1610.                value is zero.
  1611.  
  1612.      NOERRBUF  If set, standard error output is not buffered.
  1613.  
  1614.      ICONCORE  If set, a core dump is produced in the case of
  1615.                error termination.
  1616.  
  1617.      MSTKSIZE  Specifies the size in words of the main inter-
  1618.                preter stack.
  1619.  
  1620.      STRSIZE   Specifies the initial size in bytes of the allo-
  1621.                cated string region.
  1622.  
  1623.      BLOCKSIZE Specifies the initial size in bytes of the allo-
  1624.                cated block region.  HEAPSIZE is a synonym for
  1625.                BLOCKSIZE.
  1626.  
  1627.      STATSIZE  Specifies the initial size in bytes of the static
  1628.                region in which co-expressions are allocated.
  1629.  
  1630.      STATINCR  Specifies the increment for expanding the static
  1631.                region. The default increment is one-fourth the
  1632.                initial size of the static region.
  1633.  
  1634.      COEXPSIZE Specifies the size in words of co-expression
  1635.                blocks.
  1636.  
  1637.      QLSIZE    Specifies the amount of space used for pointers to
  1638.                strings during garbage collection. Used only on
  1639.                implementations with fixed memory regions.
  1640.  
  1641.    An inappropriate setting of an environment variable prevents
  1642. the program from starting.
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.                              - 24 -
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.               Appendix B - Run-Time Error Messages
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.    A list of run-time error numbers and corresponding messages
  1664. follows.  Some implementations have additional run-time errors.
  1665.  
  1666.         101     integer expected
  1667.         102     numeric expected
  1668.         103     string expected
  1669.         104     cset expected
  1670.         105     file expected
  1671.         106     procedure or integer expected
  1672.         107     record expected
  1673.         108     list expected
  1674.         109     string or file expected
  1675.         110     string or list expected
  1676.         111     variable expected
  1677.         112     invalid type to size operation
  1678.         113     invalid type to random operation
  1679.         114     invalid type to subscript operation
  1680.         115     list or table expected
  1681.         116     invalid type to element generator
  1682.         117     missing main procedure
  1683.         118     co-expression expected
  1684.         119     set expected
  1685.         120     cset or set expected
  1686.         121     function not supported
  1687.         122     set or table expected
  1688.         123     invalid type
  1689.         124     table expected
  1690.  
  1691.         201     division by zero
  1692.         202     remaindering by zero
  1693.         203     integer overflow
  1694.         204     real overflow, underflow, or division by zero
  1695.         205     value out of range
  1696.         206     negative first operand to real exponentiation
  1697.         207     invalid field name
  1698.         208     second and third arguments to map of unequal length
  1699.         209     invalid second argument to open
  1700.         210     non-ascending arguments to detab/entab
  1701.         211     by clause equal to zero
  1702.         212     attempt to read file not open for reading
  1703.         213     attempt to write file not open for writing
  1704.         214     input/output error
  1705.         215     attempt to refresh &main
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.  
  1714.                              - 25 -
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.         301     interpreter stack overflow
  1724.         302     C stack overflow
  1725.         303     inadequate space for interpreter stack
  1726.         304     inadequate space in qualifier list
  1727.         305     inadequate space in static region
  1728.         306     inadequate space in string region
  1729.         307     inadequate space in block region
  1730.  
  1731.         401     co-expressions not implemented
  1732.  
  1733.         500     program malfunction
  1734.  
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.  
  1743.  
  1744.  
  1745.  
  1746.  
  1747.  
  1748.  
  1749.  
  1750.  
  1751.  
  1752.  
  1753.  
  1754.  
  1755.  
  1756.  
  1757.  
  1758.  
  1759.  
  1760.  
  1761.  
  1762.  
  1763.  
  1764.  
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.                              - 26 -
  1781.  
  1782.  
  1783. mented
  1784.  
  1785.         500     program malfunction
  1786.  
  1787.  
  1788.  
  1789.  
  1790.  
  1791.  
  1792.  
  1793.