Annotation of researchv10dc/cmd/icon/docs/tr86-10.roff, revision 1.1

1.1     ! root        1: .so tmac.tr
        !             2: .de Ta
        !             3: .ta .8i +.8i +.8i +.8i +.8i +.8i +.8i
        !             4: ..
        !             5: .de Px
        !             6: .ta 3.5i
        !             7: ..
        !             8: .ds CF \s10- \\n(PN - \s0
        !             9: .de Ap
        !            10: .bp
        !            11: .ce 10
        !            12: \f3\\$1\f1
        !            13: .ce 0
        !            14: .sp 2
        !            15: .if !''\\$2' 'so \\$2
        !            16: ..
        !            17: .TR 86-10a
        !            18: .DA "June 8, 1986"
        !            19: .Gr
        !            20: .TL
        !            21: Version 6.0 of Icon
        !            22: .AU
        !            23: Ralph E. Griswold
        !            24: William H. Mitchell
        !            25: Janalee O'Bagy
        !            26: .AE
        !            27: .tr *\(**
        !            28: .NH
        !            29: Background
        !            30: .PP
        !            31: Different versions of the Icon programming language are identified by numbers. The first,
        !            32: Version 1, was superceded by Version 2. Starting with Version 3, the
        !            33: implementation of Icon was completely changed. While Version 2 is still
        !            34: in use on some computers, Version 5 is by far the mostly widely
        !            35: used version of Icon.
        !            36: The features of Version 5 are described in the ``Icon book'' [1].
        !            37: Since this book is the only complete and generally available description
        !            38: of a widely used version of Icon, Version 5 is sometimes called
        !            39: ``standard Icon''.
        !            40: .PP
        !            41: Since Icon is the byproduct of a research effort that
        !            42: is concerned with the development of novel programming language
        !            43: features,
        !            44: some extensions to the standard language are inevitable.
        !            45: These extensions are incorporated as features of new releases of
        !            46: the implementation.
        !            47: These releases are identified by minor version numbers that are separated
        !            48: from the major version number by a decimal point. For example, Version 5.10
        !            49: is the tenth minor revision of Version 5.
        !            50: .PP
        !            51: Because of the relationship between language design and implementation,
        !            52: major version numbers usually contain significant language changes
        !            53: that have accumulated over a number of minor revisions, while minor
        !            54: version numbers primarily reflect implementation changes.
        !            55: .PP
        !            56: Recently an implementation of Icon written almost entirely in C has
        !            57: been completed. This implementation is so different from previous
        !            58: ones that some designation is needed to distinguish it from other
        !            59: implementations. It therefore has been designated Version 6.
        !            60: Despite the change in major version number, the Version 6.0
        !            61: language is nearly the same as the Version 5.10 language and
        !            62: the Version 5 book continues to serve as the primary reference
        !            63: for Version 6.
        !            64: Since a revision of a book is a major and time-consuming process,
        !            65: this report is provided to supplement the present Icon book.
        !            66: Together, the book and this report provide a description of
        !            67: Version 6.0.
        !            68: .PP
        !            69: Most of the language extensions in Version 6.0 are upward-compatible with
        !            70: Version 5 and almost all programs that contain only standard Version 5
        !            71: features work properly under Version 6.0.
        !            72: However, some of the more implementation-dependent aspects described
        !            73: in the Version 5 book are now obsolete and there are significant new
        !            74: language features.
        !            75: .NH
        !            76: Features of Version 6.0
        !            77: .PP
        !            78: Version 6.0 extensions consist of a declaration to facilitate the use
        !            79: of Icon procedure libraries, a new set data type, new options for sorting
        !            80: tables, new syntax to support the use of co-expressions in programmer-defined
        !            81: control operations, the invocation of functions and operators by their
        !            82: string names, and a few new functions.
        !            83: .NH 2
        !            84: The Link Declaration
        !            85: .PP
        !            86: The link declaration simplifies the inclusion of
        !            87: separately translated libraries of Icon procedures. If \*Micont\fR [2] is run
        !            88: with the \*M\-c\fR option, source files are translated into intermediate
        !            89: \fIucode\fR files (with names ending in \*M.u1\fR and \*M.u2\fR).
        !            90: For example,
        !            91: .Ds
        !            92: icont -c libe.icn
        !            93: .De
        !            94: produces the ucode files \*Mlibe.u1\fR and \*Mlibe.u2\fR. The ucode files
        !            95: can be incorporated in another program with the new link
        !            96: declaration, which has the form
        !            97: .Ds
        !            98: link libe
        !            99: .De
        !           100: The argument of \*Mlink\fR is, in general, a list of identifiers or
        !           101: string literals that specify the names of files to be linked (without
        !           102: the \*M.u1\fR or \*M.u2\fR). Thus, when running under \*U,
        !           103: .Un
        !           104: .Ds
        !           105: link libe, "/usr/icon/ilib/collate"
        !           106: .De
        !           107: specifies the linking of \*Mlibe\fR in the current directory and
        !           108: \*Mcollate\fR in \*M/usr/icon/ilib\fR.
        !           109: The syntax for paths may be different for other operating systems.
        !           110: .PP
        !           111: The environment variable \*MIPATH\fR controls the location of files
        !           112: specified in link declaratinos. The value of \*MIPATH\fR should be a
        !           113: blank-separated string\s-2\u1\d\s0
        !           114: .FS
        !           115: \s-2\u1\d\s0\^The separator is a colon for UNIX systems under Versions 5.9 and
        !           116: 5.10.
        !           117: .FE
        !           118: of the form \fIp\^\*(sd1\*(su\^\0\^p\^\*(sd2\*(su\0 \*(El p\^\*(sdn\*(su\fR where each
        !           119: \fIp\^\*(sdi\*(su\fR names a directory.
        !           120: Each directory is searched in turn to locate files named in link
        !           121: declarations. The default value of \*MIPATH\fR is the
        !           122: current directory.
        !           123: .NH 2
        !           124: Sets
        !           125: .PP
        !           126: Sets are unordered collections of values and have many of the properties normally
        !           127: associated with sets in the mathematical sense.
        !           128: The function
        !           129: .Ds
        !           130: set(a)
        !           131: .De
        !           132: creates a set that contains the distinct elements of the list \*Ma\fR. For
        !           133: example,
        !           134: .Ds
        !           135: set(\^["abc",\*b3])
        !           136: .De
        !           137: creates a set with two members, \*Mabc\fR and 3.
        !           138: Note that
        !           139: .Ds
        !           140: set(\^[\^])
        !           141: .De
        !           142: creates an empty set.
        !           143: Sets, like
        !           144: other data aggregates in Icon, need not be homogeneous \(em a set
        !           145: may contain members of different types.
        !           146: .PP
        !           147: Sets, like other Icon data aggregates, are represented by pointers to
        !           148: the actual data. Sets can be members of sets, as in
        !           149: .Ds
        !           150: s1 := set(\^[1,\*b2,\*b3])
        !           151: s2 := set(\^[s1,\*b\^[\^]])
        !           152: .De
        !           153: in which \*Ms2\fR contains two members, one of which is a set of three
        !           154: members and the other of which is an empty list.
        !           155: .PP
        !           156: Any specific value can occur only once in a set. For example,
        !           157: .Ds
        !           158: set(\^[1,\*b2,\*b3,\*b3,\*b1])
        !           159: .De
        !           160: creates a set with the three members 1, 2, and 3.
        !           161: Set membership is determined the same way the equivalence of
        !           162: values is determined in the operation
        !           163: .Ds
        !           164: x === y
        !           165: .De
        !           166: For example,
        !           167: .Ds
        !           168: set(\^[\^[\^],\*b\^[\^]])
        !           169: .De
        !           170: creates a set that contains two distinct empty lists.
        !           171: .PP
        !           172: Several set operations are provided. The function
        !           173: .Ds
        !           174: member(s,\*bx)
        !           175: .De
        !           176: succeeds and returns the value of \*Mx\fR if \*Mx\fR is a member of
        !           177: \*Ms\fR, but fails otherwise. Note that
        !           178: .Ds
        !           179: member(s1,\*bmember(s2,\*bx))
        !           180: .De
        !           181: succeeds if \*Mx\fR is a member of both \*Ms1\fR and \*Ms2\fR.
        !           182: .PP
        !           183: The function
        !           184: .Ds
        !           185: insert(s,\*bx)
        !           186: .De
        !           187: inserts \*Mx\fR into the set \*Ms\fR and returns the value of \*Ms\fR.
        !           188: Note that \*Minsert(s,\*bx)\fR is similar to \*Mput(a,\*bx)\fR in form.
        !           189: A set may contain (a pointer to) itself:
        !           190: .Ds
        !           191: insert(s,\*bs)
        !           192: .De
        !           193: adds \*Ms\fR as an member of itself.
        !           194: .PP
        !           195: The function
        !           196: .Ds
        !           197: delete(s,\*bx)
        !           198: .De
        !           199: deletes the member \*Mx\fR from the set \*Ms\fR and returns the
        !           200: value of \*Ms\fR.
        !           201: .PP
        !           202: The functions \*Minsert(s,\*bx)\fR and \*Mdelete(s,\*bx)\fR always
        !           203: succeed, whether or not \*Mx\fR is in \*Ms\fR. This allows their
        !           204: use in loops
        !           205: in which failure may occur for other reasons. For example,
        !           206: .Ds
        !           207: s := set(\^[\^])
        !           208: while insert(s,\*bread())
        !           209: .De
        !           210: builds a set that consists of the (distinct) lines from the standard
        !           211: input file.
        !           212: .PP
        !           213: The operations
        !           214: .Ds
        !           215: s1 ++ s2
        !           216: s1 ** s2
        !           217: s1 -\^- s2
        !           218: .De
        !           219: create the union, intersection, and difference of \*Ms1\fR and \*Ms2\fR,
        !           220: respectively. In each case, the result is a new set.
        !           221: .PP
        !           222: The use of these operations on csets is unchanged. There is no
        !           223: automatic type conversion between csets and sets; the result of the
        !           224: operation depends on the types of the arguments. For example,
        !           225: .Ds
        !           226: \&'aeiou' ++ 'abcde'
        !           227: .De
        !           228: produces
        !           229: the cset \*M\(fmabcdeiou\(fm\fR, while
        !           230: .Ds
        !           231: set(\^[1,\*b2,\*b3]) ++ set(\^[2,\*b3,\*b4])
        !           232: .De
        !           233: produces a set that contains 1, 2, 3, and 4. On the other hand,
        !           234: .Ds
        !           235: set(\^[1,\*b2,\*b3]) ++ 4
        !           236: .De
        !           237: results in Run-time Error 119 (\*Mset expected\fR).
        !           238: .PP
        !           239: The functions and operations of Icon that apply to other data aggregates
        !           240: apply to sets as well. For example, if \*Ms\fR is a set,
        !           241: .Ds
        !           242: *s
        !           243: .De
        !           244: is the size of \*Ms\fR (the number of members in it). Similarly,
        !           245: .Ds
        !           246: type(s)
        !           247: .De
        !           248: produces the string \*Mset\fR.
        !           249: The string images of sets are in the
        !           250: same style as for other aggregates, with the size enclosed in
        !           251: parentheses. Therefore,
        !           252: .Ds
        !           253: s := set(\^["abc",\*b3])
        !           254: write(image(s))
        !           255: .De
        !           256: writes \*Mset(2)\fR.
        !           257: .PP
        !           258: The operation
        !           259: .Ds
        !           260: !s
        !           261: .De
        !           262: generates the members of \*Ms\fR, but in no predictable order. Similarly,
        !           263: .Ds
        !           264: ?s
        !           265: .De
        !           266: produces a randomly selected member of \*Ms\fR.
        !           267: These operations produce values, not variables \(em it is not possible
        !           268: to assign a value to \*M!s\fR or \*M?s\fR.
        !           269: .PP
        !           270: The function
        !           271: .Ds
        !           272: copy(s)
        !           273: .De
        !           274: produces a new set, distinct from \*Ms\fR, but which contains the same
        !           275: members as \*Ms\fR. The copy is made in the same fashion as the copy
        !           276: of a list \(em the members themselves are not copied.
        !           277: .PP
        !           278: The function
        !           279: .Ds
        !           280: sort(s)
        !           281: .De
        !           282: produces a list containing the members of \*Ms\fR in sorted order.
        !           283: Sets occur after tables but before records in Icon's collating sequence.
        !           284: .SH
        !           285: Examples
        !           286: .a
        !           287: .LP
        !           288: \fIWord Counting:\fR
        !           289: .PP
        !           290: The following program lists, in alphabetical order, all the different
        !           291: words that occur in standard input:
        !           292: .Ds
        !           293: .Px
        !           294: procedure main()
        !           295:    letter := &lcase ++ &ucase
        !           296:    words := set(\^[\^])
        !           297:    while text := read() do
        !           298:       text ? while tab(upto(letter)) do
        !           299:          insert(words,\*btab(many(letter)))
        !           300:    every write(!sort(words))
        !           301: end
        !           302: .De
        !           303: .LP
        !           304: \fIThe Sieve of Eratosthenes:\fR
        !           305: .PP
        !           306: The follow program produces prime numbers, using the classical ``Sieve of
        !           307: Eratosthenes'':
        !           308: .Ds
        !           309: .Px
        !           310: procedure main()
        !           311:    local limit, s, i
        !           312:    limit := 5000
        !           313:    s := set(\^[])
        !           314:    every insert(s,\*b1 to limit)
        !           315:    every member(s,\*bi := 2 to limit) do
        !           316:       every delete(s,\*bi + i to limit by i)
        !           317:    primes := sort(s)
        !           318:    write("There are ",\*b*primes,\*b" primes in the first ",\*blimit,\*b" integers.")
        !           319:    write("The primes are:")
        !           320:    every write(right(!primes,\*b*limit + 1))
        !           321: end
        !           322: .De
        !           323: .NH 2
        !           324: Sorting Tables
        !           325: .PP
        !           326: Two new options are available for sorting tables. These options are specified by
        !           327: the values 3 and 4 as the second argument of \*Msort(t,\*bi)\fR.
        !           328: Both of these options produce a single list in which the entry values and
        !           329: assigned values of table elements alternate. A value of 3 for \*Mi\fR
        !           330: produces a list in which the entry values are in sorted order, and
        !           331: a value of 4 produces a list in which the assigned values are in sorted
        !           332: order. For example, if the table \*Mwcount\fR contains elements whose entry values are
        !           333: words and whose corresponding assigned values are counts, the following
        !           334: code segment writes out a list of the words and their counts, with the
        !           335: words in alphabetical order:
        !           336: .Ds
        !           337: a := sort(wcount,\*b3)
        !           338: every i := 1 to *a - 1 by 2 do
        !           339:    write(a\^[i]," : ",a\^[i + 1])
        !           340: .De
        !           341: .PP
        !           342: The main advantage of the new sorting options is that they only produce
        !           343: a single list, rather than a list of lists as produced by the options
        !           344: 1 and 2. The amount of space needed for the single list is proportionally much less
        !           345: than for the list of lists.
        !           346: .NH 2
        !           347: Programmer-Defined Control Operations
        !           348: .PP
        !           349: As described in [3], co-expressions can be used to provide programmer-defined
        !           350: control operations. Version 6.0 provides support for this facility by means
        !           351: of an alternative syntax for procedure invocation in which the arguments
        !           352: are passed in a list of co-expressions. This syntax uses braces
        !           353: in place of parentheses:
        !           354: .Ds
        !           355: p{\*1, \*2, \*(El, \*n}
        !           356: .De
        !           357: is equivalent to
        !           358: .Ds
        !           359: p(\^[create \*1, create \*2, \*(El, create \*n])
        !           360: .De
        !           361: Note that
        !           362: .Ds
        !           363: p{\^}
        !           364: .De
        !           365: is equivalent to
        !           366: .Ds
        !           367: p(\^[\^\^])
        !           368: .De
        !           369: .NH 2
        !           370: Invocation By String Name
        !           371: .PP
        !           372: A string-valued expression that corresponds to the
        !           373: name of a procedure or operation can be used in place of the
        !           374: procedure or operation in an invocation expression. For example,
        !           375: .Ds
        !           376: "image"(x)
        !           377: .De
        !           378: produces the same call as
        !           379: .Ds
        !           380: image(x)
        !           381: .De
        !           382: and
        !           383: .Ds
        !           384: "-"(i,\*bj)
        !           385: .De
        !           386: is equivalent to
        !           387: .Ds
        !           388: i - j
        !           389: .De
        !           390: .PP
        !           391: In the case of operator symbols with unary and binary forms, the number of arguments determines
        !           392: the operation. Thus
        !           393: .Ds
        !           394: "-"(i)
        !           395: .De
        !           396: is equivalent to
        !           397: .Ds
        !           398: -i
        !           399: .De
        !           400: Since \*Mto-by\fR is an operation, despite its reserved-word syntax,
        !           401: it is included in this facility with the string name \*M"..."\fR .
        !           402: Thus
        !           403: .Ds
        !           404: "..."(1,\*b10,\*b2)
        !           405: .De
        !           406: is equivalent to
        !           407: .Ds
        !           408: 1 to 10 by 2
        !           409: .De
        !           410: Similarly, range specifications are represented by \*M":"\fR, so that
        !           411: .Ds
        !           412: ":"(s,\*bi,\*bj)
        !           413: .De
        !           414: is equivalent to
        !           415: .Ds
        !           416: s\^[i:j]
        !           417: .De
        !           418: .PP
        !           419: Defaults are not provided for omitted or null-valued arguments in this
        !           420: facility. Consequently,
        !           421: .Ds
        !           422: "..."(1,\*b10)
        !           423: .De
        !           424: results in a run-time error when it is evaluated.
        !           425: .PP
        !           426: The subscripting operation is available with the string name
        !           427: \*M"[\^\^]"\fR. Thus
        !           428: .Ds
        !           429: "[\^\^]"(&lcase,\*b3)
        !           430: .De
        !           431: produces \*Mc\fR.
        !           432: .PP
        !           433: Arguments to operators invoked by string names are dereferenced. Consequently,
        !           434: string invocation for assignment operations is ineffective and results
        !           435: in error termination.
        !           436: .PP
        !           437: String names are available for the operations in Icon, but not for
        !           438: control structures. Thus
        !           439: .Ds
        !           440: "|"(\*1,\*b\*2)
        !           441: .De
        !           442: is erroneous.
        !           443: Note that string scanning is a control structure.
        !           444: .PP
        !           445: Field references, of the form
        !           446: .Ds
        !           447: \*0 . \fIfieldname\fR
        !           448: .De
        !           449: are not operations in the ordinary sense and are not available
        !           450: via string invocation.
        !           451: In addition, conjunction is not available via string invocation, since
        !           452: no operation is actually performed.
        !           453: .PP
        !           454: String names for procedures are available through global identifiers.
        !           455: Note that the names of functions, such as \*Mimage\fR, are global
        !           456: identifiers. Similarly, any procedure-valued global identifier may be
        !           457: used as the string name of a procedure. Thus in
        !           458: .Ds
        !           459: global q
        !           460: 
        !           461: procedure main()
        !           462:    q := p
        !           463:    "q"("hi")
        !           464: end
        !           465: 
        !           466: procedure p(s)
        !           467:    write(s)
        !           468: end
        !           469: .De
        !           470: the procedure \*Mp\fR is invoked via the global identifier \*Mq\fR.
        !           471: .NH 2
        !           472: New Functions
        !           473: .PP
        !           474: The function \*Mproc(x,\*bi)\fR
        !           475: converts \*Mx\fR to a procedure, if possible.
        !           476: If \*Mx\fR is procedure-valued, its value is returned unchanged. If the
        !           477: value of \*Mx\fR is a string that corresponds to the name of a procedure
        !           478: as described in the preceding section, the corresponding procedure
        !           479: value is returned.
        !           480: The value of \*Mi\fR is used to distinguish between
        !           481: unary and binary operators.
        !           482: For example, \*Mproc("*",\*b2)\fR produces the multiplication operator, while
        !           483: \*Mproc("*",\*b1)\fR produces the size operator.
        !           484: The default value for \*Mi\fR is 1.
        !           485: If \*Mx\fR cannot be converted to a procedure, \*Mproc(x,\*bi)\fR fails.
        !           486: .PP
        !           487: The function \*Mseq(i,\*bj)\fR generates an infinite sequence of
        !           488: integers starting at \*Mi\fR with increments of \*Mj\fR. An omitted
        !           489: or null-valued argument defaults to 1. For example,
        !           490: \*Mseq()\fR generates 1, 2, 3, \*(El .
        !           491: .PP
        !           492: Storage is allocated automatically during the
        !           493: execution of an Icon program, and garbage collections
        !           494: are performed automatically to reclaim storage for subsequent
        !           495: reallocation. Garbage collection normally only occurs when
        !           496: it is necessary. Garbage collection can be forced by the
        !           497: function
        !           498: \*Mcollect()\fR.
        !           499: .br
        !           500: .ne 1.5i
        !           501: .NH 2
        !           502: Minor Language Changes
        !           503: .PP
        !           504: There are two minor language changes:
        !           505: .RS
        !           506: .IP \(bu 4n
        !           507: The keyword \*M&options\fR of Version 5.10 is not present in Version 6.0.
        !           508: .IP \(bu
        !           509: Version 6.0 reads the last line of a file, even if that line does
        !           510: not end with a newline; Version 5 discards such a line.
        !           511: .RE
        !           512: .NH 2
        !           513: Version Checking
        !           514: .PP
        !           515: The Icon translator converts a source-language program to an
        !           516: intermediate form, called \fIucode\fR. The Icon linker converts
        !           517: one or more ucode files to a binary form called \fIicode\fR. The
        !           518: format of Version 6.0 ucode and icode files is different from
        !           519: that of earlier versions.
        !           520: To avoid the possibility of malfunction
        !           521: due to incompatible ucode and icode formats, Version 6.0 checks
        !           522: both ucode and icode files and terminates processing with an
        !           523: error message if the versions are not correct.
        !           524: .NH
        !           525: Obsolete and Changed Features of Version 5
        !           526: .PP
        !           527: The original implementation of Version 5 supported both a compiler (\*Miconc\fR)
        !           528: and an interpreter (\*Micont\fR).
        !           529: Version 6.0 supports only
        !           530: an interpreter. Interpretation is only slightly slower than the execution
        !           531: of compiled code and the interpreter is portable and gets into
        !           532: execution much more quickly than the compiler. However, it is not
        !           533: possible to load C functions with the interpreter as it was with the compiler.
        !           534: A system for
        !           535: personalized interpreters [4] is included with Version 6.0 for UNIX systems to
        !           536: make it comparatively easy to add new functions and otherwise modify the Icon run-time system.
        !           537: .PP
        !           538: Some run-time environment variables have changed; see Appendix A.
        !           539: A number of error messages have been changed.
        !           540: Appendix B contains a list of run-time error messages.
        !           541: .sp -1
        !           542: .NH
        !           543: Known Bugs in Version 6.0
        !           544: .PP
        !           545: .RS
        !           546: .IP \(bu
        !           547: The translator does not detect arithmetic overflow in conversion of
        !           548: numeric literals. Very large numeric literals may have incorrect values.
        !           549: .IP \(bu
        !           550: Integer overflow on multiplication and exponentiation is not detected
        !           551: during execution.
        !           552: Such overflow may occur during type conversion.
        !           553: .IP \(bu
        !           554: Line numbers may be wrong in diagnostic messages related to lines with continued
        !           555: quoted literals.
        !           556: .IP \(bu
        !           557: In some cases, trace messages may show the return of subscripted
        !           558: values, such as \*M&null\^[2]\fR, that would be erroneous if they were
        !           559: dereferenced.
        !           560: .IP \(bu
        !           561: If a long file name for an Icon source-language program is truncated by
        !           562: the operating system,
        !           563: mysterious diagnostic
        !           564: messages may occur during linking.
        !           565: .IP \(bu
        !           566: Stack overflow is checked using a heuristic that may not always be effective.
        !           567: .IP \(bu
        !           568: If an expression such as
        !           569: .Ds
        !           570: \*Mx := create \*0
        !           571: .De
        !           572: is used in a loop, and
        !           573: \*Mx\fR is not a global variable, unreferenceable co-expressions are
        !           574: generated by each successive \*Mcreate\fR operation.
        !           575: These co-expressions are not
        !           576: garbage collected.  This problem can be circumvented
        !           577: by making \*Mx\fR a global variable or by assigning a value to \*Mx\fR before
        !           578: the \*Mcreate\fR operation, as in
        !           579: .Ds
        !           580: x := &null
        !           581: x := create \*0
        !           582: .De
        !           583: .IP \(bu
        !           584: Stack overflow in a co-expression may not
        !           585: be detected
        !           586: and may cause mysterious program malfunction.
        !           587: .IP \(bu
        !           588: Co-expressions were designed to support coroutine programming
        !           589: as well as the more usual application for the controlled production
        !           590: of the results of a generator.
        !           591: However, the implementation is not sufficiently general to support
        !           592: coroutines. In Version 5, the use of co-expressions in a coroutine
        !           593: fashion could produce program malfunction. In Version 6.0, such uses
        !           594: are prevented and cause error termination. As a consequence, some uses of co-expressions that
        !           595: worked in Version 5 may not work in Version 6.0. In particular, the
        !           596: example in Section 13.4.2 of the Icon book does not work in
        !           597: Version 6.0.
        !           598: .IP \(bu
        !           599: The garbage collector was designed for machines with comparatively small
        !           600: address spaces and may not perform well for computers with very large
        !           601: address spaces.
        !           602: In particular, if
        !           603: an attempt is made to create a very large data object that will
        !           604: not fit into memory (such as a million-element list), it takes
        !           605: an inordinately long time to determine that the object can
        !           606: not be allocated.
        !           607: .RE
        !           608: .NH
        !           609: Possible Differences Among Version 6.0 Implementations
        !           610: .PP
        !           611: Version 6.0 of Icon is written almost entirely in C and most of its
        !           612: features are machine-independent. Appendix B of the Icon book lists
        !           613: differences that may occur because of different machine architectures.
        !           614: In addition to the differences listed there, the implementation of
        !           615: sets and tables uses a parameter that is different for 16- and 32-bit
        !           616: computers. This parameter determines how set members and table elements
        !           617: are physically stored as a result of hashing. The difference only is
        !           618: noticeable in the results produced by \*M!x\fR and \*M?x\fR, where
        !           619: \*Mx\fR is a set or a table.
        !           620: .PP
        !           621: A few aspects of the implementation of Version 6.0 are specific to
        !           622: different computer architectures and operating systems. Co-expressions
        !           623: require a context switch that is implemented in assembly language.
        !           624: If this context switch is not implemented, an attempt to activate a
        !           625: co-expression results in error termination.
        !           626: Arithmetic overflow checking also generally requires assembly-language
        !           627: routines and may not be supported on some implementations of Version 6.0.
        !           628: .PP
        !           629: Some features of Icon, such as opening a pipe for i/o and the \*Msystem\fR function,
        !           630: are closely related to UNIX. These features should work correctly
        !           631: for Version 6.0 running on UNIX systems, but they may not be supported
        !           632: on other operating systems.
        !           633: .SH
        !           634: Acknowledgements
        !           635: .PP
        !           636: In addition to the authors of this report, several persons contributed to
        !           637: the implementation of Version 6.0 of Icon.
        !           638: The implementation of sets and the new sorting options were done by Rob McConeghy.
        !           639: Other major contributors include Gregg Townsend, Chris Janton, and
        !           640: Kelvin Nilsen.
        !           641: .SH
        !           642: References
        !           643: .LP
        !           644: 1.  Griswold, Ralph E. and Madge T. Griswold. \fIThe Icon Programming
        !           645: Language\fR, Prentice-Hall, Inc., Englewood Cliffs, New Jersey. 1983.
        !           646: .LP
        !           647: 2.  Griswold, Ralph E. \fIICONT(1)\fR,
        !           648: manual page for \fIUNIX Programmer's Manual\fR, Department of Computer
        !           649: Science, The University of Arizona. May 1986.
        !           650: .LP
        !           651: 3.  Griswold, Ralph E. and Michael Novak. ``Programmer-Defined Control
        !           652: Operations'', \fIThe Computer Journal\fR, Vol. 26, No. 2 (May 1983).
        !           653: .LP
        !           654: 4.  Griswold, Ralph E. \fIPersonalized Interpreters for Version 6.0 of Icon\fR,
        !           655: Technical Report TR 86-12, Department of Computer Science, The University of
        !           656: Arizona. May 1985.
        !           657: .Ap "Appendix A \(em Environment Variables"
        !           658: .sp
        !           659: .PP
        !           660: There are a number of environment variables that can be set to
        !           661: override the default values for sizes of Icon's storage regions
        !           662: and other run-time parameters. These environment variables are:
        !           663: .RS
        !           664: .IP \*MTRACE\fR 1i
        !           665: The initial value of \*M&trace\fR. The default value is zero.
        !           666: .IP \*MNBUFS\fR
        !           667: The number of input-output buffers.
        !           668: The default value is 10 for computers with large address spaces and
        !           669: 5 for computers with small address spaces.
        !           670: .IP \*MNOERRBUF\fR
        !           671: No buffering of standard error output.
        !           672: .IP \*MICONCORE\fR
        !           673: Produce a core dump in the case of error termination.
        !           674: .IP \*MMSTKSIZE\fR
        !           675: The size in words of the main interpreter stack. The default value is
        !           676: 10000 for machines with large address spaces and 3000 for machines
        !           677: with small address spaces.
        !           678: .IP \*MSTRSIZE\fR
        !           679: The initial size in bytes of the allocated string region. The default value is
        !           680: 51200 for machines with large address spaces and 10240 for machines
        !           681: with small address spaces.
        !           682: .IP \*MHEAPSIZE\fR
        !           683: The initial size in bytes of the allocated block region. The default value is
        !           684: 51200 for machines with large address spaces and 10240 for machines
        !           685: with small address spaces.
        !           686: .IP \*MSTATSIZE\fR
        !           687: The initial size in bytes of the static region in which co-expressions are
        !           688: allocated. The default value is 20480 for machines with large
        !           689: address spaces and 1024 for machines with small address spaces.
        !           690: .IP \*MSTATINCR\fR
        !           691: The increment for expanding the static region. The default increment
        !           692: is one-fourth the initial size of the static region.
        !           693: .IP \*MCOEXPSIZE\fR
        !           694: The size in words of co-expression blocks. The default value is 2000 for
        !           695: machines with large address spaces and 1000 for machines with
        !           696: small address spaces.
        !           697: .RE
        !           698: .Ap "Appendix B \(em Run-Time Error Messages"
        !           699: .sp 2
        !           700: .DS
        !           701: .ft R
        !           702: .ta .8i
        !           703: 101    integer expected
        !           704: 102    numeric expected
        !           705: 103    string expected
        !           706: 104    cset expected
        !           707: 105    file expected
        !           708: 106    procedure or integer expected
        !           709: 107    record expected
        !           710: 108    list expected
        !           711: 109    string or file expected
        !           712: 110    string or list expected
        !           713: 111    variable expected
        !           714: 112    invalid type to size operation
        !           715: 113    invalid type to random operation
        !           716: 114    invalid type to subscript operation
        !           717: 115    list or table expected
        !           718: 116    invalid type to element generator
        !           719: 117    missing main procedure
        !           720: 118    co-expression expected
        !           721: 119    set expected
        !           722: 
        !           723: 201    division by zero
        !           724: 202    remaindering by zero
        !           725: 203    integer overflow
        !           726: 204    real overflow underflow or division by zero
        !           727: 205    value out of range
        !           728: 206    negative first operand to real exponentiation
        !           729: 207    invalid field name
        !           730: 208    second and third arguments to map of unequal length
        !           731: 209    invalid second argument to open
        !           732: 210    argument to system function too long
        !           733: 211    by clause equal to zero
        !           734: 212    attempt to read file not open for reading
        !           735: 213    attempt to write file not open for writing
        !           736: 214    recursive co-expression activation
        !           737: 
        !           738: 301    interpreter stack overflow
        !           739: 302    C stack overflow
        !           740: 303    unable to expand memory region
        !           741: 304    memory region size changed
        !           742: .DE

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.