[comp.lang.modula2] Abstract data types and generics

ob@IFI.UIB.NO (Ole Bjorn Tuftedal) (04/04/91)

I have read with interest the recent messages about abstract
data types and generic modules.

In three following messages I'll post a generic sort by Richard S. Wiener,
from SIGPLAN Notices, V19 #3, March 1984, pp 66-72.  I have tested it
on Logitech Modula-2 v. 3.x for MSDOS.

Part 1 is MODULE TstGenSorting which shows the same sort procedure
applied to completely different data.
Part 2 is DEFINITION MODULE GenericSorting.
Part 3 is IMPLEMENTATION MODULE GenericSorting.

-------------------------------------------------------------------

There are a few good books available.  I'll mention two here:

Gary a. Ford / Richard S. Wiener:
   "Modula-2 A Software Development Approach" (John Wiley & Sons, 1985)
Part One:  "Introduction to Modula-2", focuses on the syntax of M-2,
   138 pages and 18 exercises.
Part Two:  "Software Development with Modula-2", discusses the advanced
   features of the language, both high and low level.  The main focus is
   on data abstraction and data structures with an object oriented approach
   to software development (in the words of the authors).
   Topics include:
   - Static and dynamic implementations of (generic) stacks, queues, strings
   and sets;
   - a dynamic matrix data type with a generic linear equations solver;
   - the process abstraction with device handling and interrupts;
   - object oriented software design with a couple of longer case studies
   (editor-spelling checker and a Modula-2 case conversion preprosessor).
   225 pages with many exercises.

Richard F. Sincovec / Richard S. Wiener:
   "Data Structures Using Modula-2" (John Wiley & Sons, 1986), 500 pages.
This is a very good book indeed.
The major emphasis of the book is on abstract data types and their
implementations.  A central feature is the use of generic element types
for all the major data structures (stacks, queues, lists and trees).  Among
the more advanced subjects are search tables using hash tables (probabilistic
and virtual hashing), a thorough treatment of balanced trees (AVL trees,
B trees), sorting, memory management.

Ole-Bjorn Tuftedal
University of Bergen, Norway
Internet:  tuftedal@ifi.uib.no
Bitnet:    sinot@nobergen