[Icon home]

Release Notes for Version 9.4.2 of Icon

Gregg M. Townsend
Department of Computer Science
The University of Arizona

www.cs.arizona.edu/icon/v942/relnotes.htm
Last updated April 9, 2003

Introduction

Version 9.4.2 of Icon is a minor update to version 9.4.1 of Icon. The 256-color graphics limit has been removed, and a configuration for Cygwin (on Windows) has been added. Some minor bugs have been fixed.

The Icon language is unchanged, and this Unix implementation remains compatible at the source level with Icon 9.3 for Windows.

Changes in version 9.4.2

Notable changes in this latest version are listed here. Some code cleanup work and documentation editing has also been done.

256-color limit removed

Icon's X-windows interface previously limited each window to 256 colors at one time. This limitation has been removed for the TrueColor displays provided by most modern computers. Median-cut quantization is used to select 256 image colors when WriteImage() is called to write a GIF file.

Cygwin configuration

A new configuration allows Icon to be built on the Cygwin Unix environment for Microsoft Windows. For more details see Icon on Cygwin.

Library changes

As usual, several files in the Icon program library have been added or edited. The core library files, however, remain stable.

Many changes were made to the pattern and weaving packages. Other notable changes include:

procs/cartog		add sbsize() for creating scale bars
procs/pscript		add psprotect() for escaping PostScript strings
procs/lists		add lst2str() to convert list to string
procs/pdco		add an "undulant" PDCO
procs/random		use /dev/random, if available, in randomize()
procs/records		add "move corresponding" procedure mvcorr(R1, R2)
procs/seqops		add sconcatp() and splacep()
procs/string		add procedures for finding common prefix or suffix

gprocs/mapnav		repackage the map navigation GUI from gprogs/dlgvu 
gprocs/vtext		don't let PgUp etc. insert garbage in text fields

progs/htget		send Host: spec for use with multi-domain servers
progs/shuffle		new utility for reordering lines of a file

gprogs/dlgvu		read labels; write locations; add PostScript scalebar
gprogs/gallery		better coloring, more formats, snapshot command
gprogs/histo		save histogram image to a GIF file
gprogs/trkvu		new program for viewing GPS track logs

cfuncs/ilists.c		new support code for array access by loadable functions

Minor changes

Other recent feature additions

New features added since the publication of the Icon books are described below.

Scriptable source files

(new with version 9.4.1 of Icon)

An Icon source file can be made executable under Unix by prefixing it with a comment line

#!/usr/bin/env icon
and setting its execute permission bit. This uses a new icon command, which in another form allows a small Icon program to be embedded within a shell script. See the man page for details. The traditional icont command remains available for less specialized purposes.

Path searching

(new with version 9.4.0 of Icon)

Under Unix, colons (:) may now separate directories in the LPATH and IPATH environment variables as an alternative to spaces. The Icon translator and linker search these paths when looking for $include and link files respectively.

The Icon program library is now searched automatically, but LPATH and IPATH can still be set to control the search order. For version 9.4, the effective path in each case is:

  1. The current directory
  2. Any directories named by the environment variable
  3. The Icon library directory

Other changes affect the configuration of Icon at installation time and the way executable Icon programs locate the interpreter. These changes, which are transparent to most users, are discussed in more detail on the File Organization page.

Reading directory contents

(new with version 9.3.2 of Icon)

The files in a directory can be listed by opening the directory as a file. Subsequent reads return the names of the files contained in the directory. The names are returned in no particular order, and for Unix, the directories "." and ".." are included.

Reading foreign text files

(new with version 9.3.1 of Icon)

The function read() recognizes three kinds of line terminators when reading a file opened in translated mode: Windows (CR+LF), Macintosh (CR), or Unix (LF). Consequently, text files created on one platform can be read by an Icon program running on a different platform.

Limitations, bugs, and problems

Large integers cannot be used with i to j, with seq(), or with integer-valued keywords.

Large-integer literals are constructed at run-time, so such literals are best kept outside of loops.

Conversion of a large integer to a string is quadratic in the length of the integer. Conversion of a very large integer may take a long time.

Stack overflow checking uses a heuristic that is not always effective. Stack overflow in a co-expression is especially likely to escape detection and cause a mysterious program malfunction.

If an expression such as x := create expr is used in a loop, and x is not a global variable, uncollectable co-expressions accumulate with each iteration. This problem can be circumvented by making x a global variable or by assigning a value to x before the create operation, as in

x := &null
x := create expr

Integer overflow on exponentiation may not be detected during execution. Such overflow may occur during type conversion.

Documentation

See the documentation guide for an overview of the available Icon documentation.

For installation instructions, see Installing Binaries or Building from Source as appropriate.

Acknowledgments

Frank Lhota contributed the Cygwin port. Ralph Griswold contributed a large number of program library changes. Frank Glandorf contributed dlgvu modifications. Kostas Oikonomou contributed the array support code. Christian Hudon helped with testing.