Unicon Language resources
Introduction
This page contains some resources for the Unicon programming language,
which is an object-oriented extension of the popular Icon language,
developed
at the University of Arizona.
About Icon and Unicon
Icon is a programming language developed over many years by a team at
the
University of Arizona.
A brief introduction to Icon can be found at http://www.cs.arizona.edu/icon/intro.htm
Unicon adds objects to Icon, which is a procedural language.
Unicon's
features are documented by its creator, Dr Clint Jeffery, of the New
Mexico
State University. See the Unicon pages at Sourceforge http://unicon.sourceforge.net
for
more details.
Unicon Library Classes
I am developing as an ongoing project a set of Unicon library classes.
The source code is split into several Unicon packages, as follows :-
-
gui - a complete set of gui classes for designing a modern UI. Features
include :-
-
An object hierarchy providing all the standard components required to
build
a modern application, including trees, tables, editable text areas, and
so on.
-
A fully featured menu system.
-
Easy subclassing of components to create custom components.
-
A ticker (timer) feature whereby arbitrary objects may have a tick
method
invoked at specified intervals. These methods are then scheduled
between
window events.
-
Support for modal and modeless dialogs.
-
Extensive built-in use of double buffering to eliminate unsightly
flicker
from updating displays.
-
Free application of Icon graphic attributes to components.
-
ivib - not really a library, this is a program for designing GUIs using
the above classes visually, using a drag-and-drop interface. Designs
are
output as Unicon source code, and can be re-input for further editing.
Click here for an example screen shot of Ivib.
-
lib - Some general library classes for the following :-
-
langprocs.icn - some fundamental class utilities, including functions
for
displaying, serializing and cloning objects.
-
format.icn - Formatting of numeric data.
-
gethttp.icn - Gets data from a server using the HTTP protocol,
correctly
handling retries and timeouts. Currently not working due to bugs in the
Icon runtime system.
-
money.icn - Represents monetary values.
-
process.icn - A convenient class wrapper for using multiple processes
using
Unicon's fork. See also ipc below for inter-process communication.
-
qsort.icn - An implementation of quicksort.
-
stringbuff.icn - A class to overcome Icon's inefficiency at building up
very long strings by concatenation.
-
time.icn - A date/time class.
-
url.icn - A class for representing URLs, with facilities for
encoding/decoding
with CGI paramters.
-
parser - Some classes for parsing Unicon source code, using the same
preprocessor
and grammar used by the compiler.
-
unidep - A program for creating makefile entries for a set of Unicon
input
files. This is a great help when creating a project from multiple
source
files. It ensures that each file is compiled before any of the classes
it contains are referenced by any other file.
-
unidoc - A program to produce documentation from unicon source files,
either
in html or groff format. Current HTML output for the whole
library
is available online. Steve Wampler
has
done a similar program (also called Unidoc!), which is more flexible in
that it can handle Icon source as well as Unicon. See the link below to
Steve Wampler's page for more details.
-
xml - A validating XML parser and an HTML
parser.
-
ipc - An easy-to-use interface to the Unix IPC facilities, namely
semaphores,
message queues and shared memory. Full documenation is
here
Library API documentation
Full auto-generated API documentation for the library can be found here.
A PDF document covering the gui package can be downloaded here (about 580kB).
Download
The source code is now part of the unicon sourceforge CVS repository :-
http://sourceforge.net/cvs/?group_id=10965
Other documentation
This is a page about how to use packages
in
Unicon.
Unicon major mode for Emacs
This is based on the Icon major mode. To use it, download the file unicon.el
, and place it in a convenient directory; in my case /home/rpp/bin.
Then
add the following to your .emacs file :-
;; Add the directory with unicon.el in it to emacs' search path.
;; Change the directory as appropriate.
(setq load-path (append load-path '("/home/rpp/bin")))
(autoload 'unicon-mode "unicon")
;; Define the mode for .icn files
(setq auto-mode-alist (cons '("\\.icn\\'" . unicon-mode) auto-mode-alist))
;; User setup - may be customized.
; Indentations
(setq unicon-indent-level 3)
(setq unicon-continued-statement-offset unicon-indent-level)
(setq unicon-class-indent-level unicon-indent-level)
(setq unicon-brace-offset (- unicon-indent-level))
; Spaces rather than spaces+tabs
(setq unicon-indent-use-only-spaces t)
Some other options are available. After loading, type C-h,a,unicon to
see
a list of available variables.
Because this file is based on the Icon major mode, it is subject to
the GNU general public license: see the file COPYING
Contact
My email address is r dot parlett at zen dot co dot uk.
Links
Last
modified: Sat Mar 1 14:37:21 GMT 2003