Common Lisp Extensions: ENUMERATIONS
DISCLAIMER: The code associated to these documents is not completely tested and it is bound to contain errors and omissions. This documentation may contain errors and omissions as well.
The code is released under a Berkeley-style license contained in the COPYING file. You are advised to use the code at your own risk. No warranty whatsoever is provided, the author will not be held responsible for any effect generated by your use of the library, and you can put here the scarier extra disclaimer you can think of.
This document contains a specification for ENUMERATIONS in Common Lisp. Enumeration objects are CLOS instances which encapsulate a container data structure and maintain the state of its traversal. The ENUMERATIONS package describes a protocol (an interface) that can be implemented by other classes. Some standardized enumerations for a number of standard CL data structures are also specified.
The ENUMERATIONS package is essentially a CL specification of the equivalent Java java.util.Enumeration and java.util.Iterator interfaces (cfr. the Java API specification). The main aim of the specification and of the reference implementation is to provide a familiar framework for Java, C++, Python etc. programmers while they are migrating to Common Lisp. Also, it is hoped that vendors and implementors adopt the published API and provide efficient, special-case, re-implementations of some of the package elements.
Relation with SERIES package.
The ENUMERATIONS specification is a "poor man" SERIES package, inasmuch as it does not provide for any kind of compiler optimization.
Organizational and Typographical Conventions.
This document tries to follow as closely as possible the typographical conventions of the CLHS.
All examples assume that the symbols exported by the CL.EXTENSIONS.ENUMERATIONS package are accessible at the prompt.