[comp.lang.ada] conditional compilation and standardization

emery@D74SUN.MITRE.ORG (David Emery) (12/13/89)

Bill Wolfe sez:
>  [standardization of symbols like the enumerations in SYSTEM.NAME 
>   should be ]
>   Appropriately handled in the package which provides the binding to
>   the operating system involved.  OS bindings must also be standardized,
>   and this is taking place; e.g., the IEEE 1003.5 Ada binding to Posix.
    
First, there are often options in a program which are not bound to the
operating system.  One example that I've seen used very effectively
occurs in the C source for Nethack, where features may be included or
excluded at compile time by defining or undefining certain symbols.
These features include things like different types of monsters, as
well as support for system things, such as compressing save files. 

Second, as Technical Editor for IEEE 1003.5 POSIX Ada Binding, I see
several instances in our binding where conditional compilation would
be very useful to an applications programmer, particularly one trying
to write portable software.  This is particularly true of the
execution time symbolic constants, such as the C symbols
_POSIX_NO_TRUNC and _POSIX_VDISABLE (defined in IEEE P1003.1-1988),
and depending on the application, may also be true of the compile time
symbolic constants, such as _POSIX_JOB_CONTROL.

"Ultimate standardization", even of operating system names, is a long
way away.  I don't see anyone racing around trying to standardize such
things, either.  I don't believe that it's worth waiting for,
particularly since it won't solve all the problems.

One of the weaker points of Ada for portability is its lack of a
general conditional compilation mechanism (based on some information
obtained at compile time).  I know of many examples of tricks and
techniques used by people like compiler developers, to maintain
different versions of the same code for different operating
environments (including such things as Operating System and its
variant features, presence or absence of windowing systems,
availability of third-party software, etc.)  Secondary standards (such
as O.S. bindings) are not the solution to such configuration/adaption
problems.  They help, but are not complete.

				dave emery
				emery@aries.mitre.org