Path: utzoo!attcan!uunet!actnyc!djs
From: djs@actnyc.UUCP (Dave Seward)
Newsgroups: comp.lang.ada
Subject: Re: Conditional compilation
Message-ID: <986@actnyc.UUCP>
Date: 27 Jun 88 18:01:35 GMT
References: <909*haug@vax.runit.unit.uninett> <28254@clyde.ATT.COM> <1369@wayback.UUCP>
Reply-To: djs@actnyc.UUCP (Dave Seward)
Organization: InterACT Corporation
Lines: 31

In article <1369@wayback.UUCP> arny@wayback.UUCP (Arny B. Engelson) writes:
>In article <28254@clyde.ATT.COM>, rds@moss.ATT.COM writes:
>> On the issue of conditional compilations in Ada...
>[...]
>This is an (optional) optimization step, not a standardized way of
>providing conditional compilation.  Personally, I think the "pragma"
>solution for conditional compilation works well, and would like to see
>it standardized and provided with all implementations.  Comments?

I don't like the pragma approach as it is very hard to specify it within
the bounds of pragma legality. RM 2.8(8) says "An implementation is not
allowed to define pragmas whose presence or absence infuences the legality
of the text outside such pragmas." This means that conditional compilation
pragmas could not be used to select one of multiple possible declarations,
as, without the pragmas, the program would be seen to have multiple,
conflicting declarations of the same identifier.

Additionally, a significant conditional compilation facility requires a
meta-language of its own for definition and evaluation of conditions upon
which to include text into a compilation or not. This would probably be
force fit into existing Ada rules for declarations and expressions, or
would stick out like a sore thumb.

I am in favor of a distinct facility in the programming environment, like
a preprocessor, for doing file inclusion, conditional compilation, and
the like. Go ahead and standardize it, but don't force it into the Ada
compiler. A compiler should compile the text you feed into it. Defining
that text is a job for other tools.

Dave Seward
uunet!actnyc!djs