# Release Notes for Version 9.4.1 of Icon

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

www.cs.arizona.edu/icon/v941/relnotes.htm
Last updated March 25, 2002

## Introduction

Version 9.4.1 of Icon is a minor update to version 9.4.0 of Icon. Most changes address installation and portability issues. The performance of large sets and tables is improved, and some minor bugs have been fixed. The one new feature is a command that allows an Icon source program to be used as an executable script.

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

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

## Other Changes in Version 9.4.1

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

### Huge sets and tables

The access time of a set or table is constant as long as the structure does not grow too big. Prior to this release, sets and tables began slowing down after growing beyond 20,000 elements. With this version, the limit has been raised to around 44 million elements, making much larger sets and tables feasible.

### Automatic hardware configuration

The configuration parameters `IntBits`, `WordBits`, `Double`, and `UpStack` are now configured automatically. This allows the same `linux` configuration to be used on x86, Itanium, and Alpha architectures, and presumably on others. The set of configurations has been consolidated, and some obsolete configurations removed.

### Pthreads configurations

Co-expression support requires specialized code for context switching that until now has been hardware-dependent. A new, portable set of context switching functions has been developed using POSIX threads ("pthreads") and semaphores. The new functions have been tested under Linux, FreeBSD, Solaris, Irix, and Digital Unix, and on several hardware architectures including the Intel Itanium.

Because platform-specific code is considerably faster, the pthreads version is used only when such code is not available.

### Macintosh configuration

Using the new `ppc_macos` configuration, Icon can be built and run in a terminal window on an Apple Macintosh running MacOS X version 10.1. Graphics facilities are available if XFree86 is installed.

### Library Changes

As usual, several files in the Icon program library have been added, edited, or moved. No significant changes were made to the core files. The most notable addition is a nice double-deck solitaire game, `gprogs/spider.icn`.

### Minor changes

- Added `icont -V` to print the Icon version and configuration.
- Edited Makefiles and shell scripts to work even in a non-POSIX locale.
- Altered getopt() calls to allow use of GNU getopt.
- Fixed icont to not reject an `invocable` identifier having a numeric second character.
- Enlarged the test suite by incorporating tests from Jcon.

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

Christian Hudon contributed a Hurd configuration and an automatic hardware configurator. Tony Ewing contributed the Macintosh configuration. Ralph Griswold contributed numerous library modifications. Will Evans contributed the new Spider game. Richard Aguirre, Marc Espie, Patrick Homer, Christian Hudon, Vipul Periwal, Peter Seebach, and David Slate assisted with testing.