# Release Notes for Version 9.4.3 of Icon

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

www.cs.arizona.edu/icon/v943/relnotes.htm
Last updated November 10, 2005

## Introduction

Version 9.4.3 of Icon is a minor update to version 9.4.2 of Icon. It incorporates configuration, documentation, and library updates. 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.3

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

### Configurations

The system-specific Icon configurations have been reorganized and renamed; new names focus on operating systems rather than CPU architectures. The several BSD configurations have been merged into one.

The `macintosh` configuration now supports the `loadfunc` function. This configuration has also been revised to anticipate Apple's announced migration to the x86 architecture.

A new porting guide has been written, and a new `posix` configuration has been added as a starting point in constructing new ports.

### Library changes

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

    procs/dijkstra		new procedures implement Dijkstra's control structures
    procs/html		add procedure for canonicalization of paths
    procs/matrix2		new procedures for matrix manipulation
    procs/nestlist		new procedures for representing nested lists as strings
    procs/printf		add %e format and fix a rounding problem

    progs/noise		new program for producing a random bitstream
    progs/unclog		improve logic for combining adjacent entries

    gprogs/dlgvu		improve coverage map; allow altitude in GPS data
    gprogs/gallery		faster thumbnail loading for JPEG images
    gprogs/img		many new features
    gprogs/sier		better color choices
    gprogs/trkvu		accept GPS track logs with altitude as the last field

The undocumented `save` function, which only worked on a few platforms, has been removed.

## Earlier feature additions

These features appeared in earlier releases of Icon that followed publication of the Icon books.

### Millions of colors

(new with version 9.4.2 of Icon)

Icon's X-windows interface no longer limits each window to 256 colors at one time. Median-cut quantization selects image colors when writing a GIF file.

### 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.

An "evaluation stack overflow" can occur when a procedure is called with a huge number (thousands or more) of arguments. The capacity can be increased by setting the environment variable `MSTKSIZE` or `COEXPSIZE`, as appropriate.

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.

Pathologically nested structures can provoke a memory or segmentation fault during garbage collection by reaching the stack limit. The stack limit can be raised by the `limit` or `ulimit` shell command.

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

Arthur Eschenlauer contributed the `matrix2` and `nestlist` libraries. Frank Lhota contributed the `dijkstra` library. Nolan Clayton contributed revisions to the `img` program. Michael Glass contributed revisions to the `printf` procedure. Chris Tenaglia and Andreas Almroth contributed configuration files.