I thought at first that you had done something clever,
but I see there was nothing in it, after all.
Sir Arthur Conan Doyle, The Red-Headed League
20.1 Other features of Ada
20.2 Other sources of information
20.1 Other features of Ada
As I said in the preface, this book does not pretend to provide a complete
coverage of Ada 95. Adas a big language, and it would take a much
bigger book than this to do it justice. Many of the features Ive
omitted have been omitted because you shouldnt use them, or because
youre unlikely to need to use them, or a combination of both. Others
have simply been the victims of a lack of space. Heres a list of
the major omissions and the reasons why I left them out:
- The goto statement. Ever since the 1960s the goto statement
has been denounced as the root of all unstructured evil in programming,
the source from which spaghetti code is created. Its
so bad I wont even discuss it here. Suffice it to say that three
decades after this heresy was exposed, Ada still has a goto statement.
Its really not something you want to know about.
- Pragmas and representation clauses. Pragmas are clauses which
provide hints to the compiler about possible optimisations and other compilation-related
issues. Compilers are allowed to ignore pragmas or to add extra pragmas
to the ones recommended by the language definition, so Ive avoided
mentioning them on the grounds that theyre implementation dependent.
Representation clauses allow you to control details of the internal representation
of parts of your program such as the physical memory layout of record components
and the physical location of individual objects. This again is such an
implementation-dependent issue that Ive ignored it entirely.
- The standard packages. These havent been described in
full simply because of lack of space; there are a lot of them, and it would
be very difficult to think up examples to illustrate everything in them.
You should nevertheless make the effort to familiarise yourself with whats
available if you want to be a serious Ada programmer; the standard environment
is described in detail in Annex A of the Ada 95 Reference Manual. Unless
youre familiar with whats available youll end up wasting
time reinventing the wheel; for example, I used the To_Upper function from
Ada.Characters.Handling in a couple of examples rather than write an upper
case conversion function. It would have been easy enough to write one,
but Ive got better things to do with my time. Also, To_Upper deals
correctly with accented and other non-English characters like à,
é and ñ whereas I might easily have overlooked
that sort of detail. There are also packages for direct access input/output,
command line processing, variable-length string handling, character-to-character
translation, random number generation, mathematical functions, complex
numbers and more. Some day youre likely to need to use at least some
of these things, so you need at least to know that they exist.
Some features have only been mentioned briefly:
- Loop labels and multilevel exit statements. These are a lesser
heresy than goto statements; they enable you to exit from multiple
levels of loop at once (in a single bound Jack was free!).
Although some people find them acceptable, my experience is that there
is usually a better way to do the same thing; a lot of the time its
better to consider returning from a subprogram, or possibly raising an
exception if the reason you want to get out is that an error has occurred.
- Variant records. Tagged types can generally be used more easily
instead of variant records to achieve the same effect. Variant records
are a feature inherited (ahem!) from Ada 83, which didnt have tagged
types. If you ever feel the urge to use a variant record, think about using
a family of tagged types instead.
- Decimal types. These are new in Ada 95 but compilers are not
required to support them. For this reason I didn't feel that it was worth
spending very much time on them.
- Multitasking. Although I devoted the previous
chapter to this, its
a complex enough topic that its impossible to do more than to scratch
the surface of it in a book this size. Some features (e.g the requeue
statement and entry families) weren't mentioned at all. Rather than aim
for complete coverage, I felt it would be better to concentrate on a brief
description of the essential features of multitasking in Ada 95 and content
myself with illustrating its use and interaction with object-oriented design.
20.2 Other sources of information
A lot of documentation about Ada is freely available, usually electronically
via the Internet (either on the World-Wide Web or by FTP). This includes
the Ada 95 Reference Manual and the accompanying Rationale as well as the
Annotated Reference Manual and Style Guide. Another useful document is
the Ada Programming FAQ (Frequently Asked Questions list). A lot of software
is also available in the same way, including the GNAT compiler system (which
is available for most development platforms) and a variety of other development
tools, as well as an ever-growing library of useful packages.
Heres a list of good places to start looking if youre interested
in online resources:
Paper copies of some documents can be had for the asking, and most online
resources are available on CD if you dont have convenient access
to the Internet. Here are some sources:
- Ada 95 Reference Manual and Rationale paper copies of
these are available on request from the National Technical Information
Service at 5285 Port Royal Road, Springfield, VA 22151, USA. Youll
need to quote the correct order number for the document you want: for the
Ada 95 Reference Manual its AD A293760, for the Rationale its
AD A293708 and for the Annotated Reference Manual its AD A298367.
- ASE is a collection of
resources for Ada and Software Engineering which is available as a set of
(currently) two CDs produced by Richard Conn
- BURKS is a collection of documentation
and Windows software intended for use by students which includes
material on Ada.
Produced on a non-profit basis by the author of this book, it is available
as a set of (currently) four CDs or as a single DVD.
There is a Usenet newsgroup which discusses Ada-related issues:
- comp.lang.ada if you have problems understanding some
of the trickier bits of Ada or you want information about getting hold
of particular resources, this is a good place to ask. However, youre
advised to read the Ada FAQ (see above) and think carefully before you
post in accordance with the standard netiquette; what you write
will be seen by people all over the world.
There are also a number of Ada-related special interest groups around
- ACM SIGAda a special interest group of the Association
for Computing Machinery. SIGAda publishes a quarterly journal called SIGAda
Notes. There is also a SIGAda website at http://www.acm.org/sigada/.
For more information contact the ACM at 1515 Broadway, New York, NY 10036,
USA, or at Avenue Marcel Thiry 204, 1200 Brussels, Belgium, or by e-mail
- Ada-UK a British Ada special interest group. Ada-UK publishes
a journal called Ada User in collaboration with Ada-Europe.
There is a website at http://www.adauk.org.uk/. For more
information contact Ada-UK at PO Box 322, York YO1 3GY, England.
- Ada-Europe a European Ada special interest group which
hosts an annual conference and publishes a quarterly journal called Ada-Europe
News. Ada-Europe can be contacted at ATM Computer GmbH, Bücklestrasse
15, D-78467 Konstanz, Germany, or online at http://www.ada-europe.org/.
This file is part of
Ada 95: The Craft of Object-Oriented Programming
by John English.
Copyright © John
English 2000. All rights reserved.
Permission is given to redistribute this work for non-profit educational
use only, provided that all the constituent files are distributed without
$Revision: 1.2 $
$Date: 2002/02/22 01:47:19 $