comp.lang.ada
 help / color / mirror / Atom feed
* re: conditional compilation
@ 1989-12-12  0:08 Emery
  1989-12-12 13:14 ` William Thomas Wolfe, 2847 
  0 siblings, 1 reply; 3+ messages in thread
From: Emery @ 1989-12-12  0:08 UTC (permalink / raw)


Bill Wolfe writes:
>   Now are you REALLY contending that any competent maintainer is 
>   going to fail to understand the following?

>     type foo_bar (MACHINE : SYSTEM{NAME := SYSTEM.SYSTEM_NAME) is record
>        X : Integer;
>        case MACHINE is
>           when VAX => Y : Float_64; 
>           when IBM_PC_WITH_8087 => Y : IEEE_Float;
>        end case;
>     end record;

I contend that any competent compiler will REJECT this code for (at
least) two reasons:
	1.  There is no guarantee that an arbitrary compiler will have
either of the two enumeration values "VAX" or "IBM_PC_WITH_8087" in
the type SYSTEM.NAME.  Furthermore, the declaration is ILLEGAL if the
(enumeration type) SYSTEM.NAME has additional values besides the two
mentioned (although the addition of "when others => null;" would at
least fix this problem.) 
	2.  Even if these two exist, the program is still semantically
ILLEGAL, as you would have two components both named Y, which is not
permitted. 

Furthermore, there are many reasons besides host machine name for
doing separate compilation.  One that comes immediately to mind occurs
when a specific feature is present or absent from the version of the
operating system generated for a given machine.  I've seen this rather
frequently in Unix.

L.T.F.L.
				dave emery
				emery@aries.mitre.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: re: conditional compilation
  1989-12-12  0:08 conditional compilation Emery
@ 1989-12-12 13:14 ` William Thomas Wolfe, 2847 
  1989-12-14 20:07   `  Sun Visualization Products
  0 siblings, 1 reply; 3+ messages in thread
From: William Thomas Wolfe, 2847  @ 1989-12-12 13:14 UTC (permalink / raw)


From emery@MBUNIX.MITRE.ORG (Emery):
>>   Now are you REALLY contending that any competent maintainer is 
>>   going to fail to understand the following?
> 
>>     type foo_bar (MACHINE : SYSTEM.NAME := SYSTEM.SYSTEM_NAME) is record
>>        X : Integer;
>>        case MACHINE is
>>           when VAX => Y : Float_64; 
>>           when IBM_PC_WITH_8087 => Y : IEEE_Float;
>>        end case;
>>     end record;
> 
> 	1.  There is no guarantee that an arbitrary compiler will have
> either of the two enumeration values "VAX" or "IBM_PC_WITH_8087" in
> the type SYSTEM.NAME.   [...]

   The point is that the construction would be easily understood
   by a hypothetical maintainer.  There is a need to standardize
   the set of SYSTEM.NAMEs on each pass of the validation cycle, 
   but a similar problem would arise with the proposed conditional
   compilation mechanism.  If one environment had IBM_PC_WITH_8087
   and another expressed the same hardware as IBM_PC_8087_CPU, the 
   lack of name standardization would be similarly troublesome.

   Once this standardization (required in either case) is accomplished,
   the problem is solved.  There is no need for conditional compilation.

> Furthermore, there are many reasons besides host machine name for
> doing separate compilation.  One that comes immediately to mind occurs
> when a specific feature is present or absent from the version of the
> operating system generated for a given machine.  I've seen this rather
> frequently in Unix.

   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.
    
   Conditional compilation would introduce an entirely new mechanism;
   such a move must be justified in terms of benefits which cannot
   reasonably be obtained using existing mechanisms.  The situations 
   cited thus far do not appear to satisfy this requirement.  


   Bill Wolfe, wtwolfe@hubcap.clemson.edu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: re: conditional compilation
  1989-12-12 13:14 ` William Thomas Wolfe, 2847 
@ 1989-12-14 20:07   `  Sun Visualization Products
  0 siblings, 0 replies; 3+ messages in thread
From:  Sun Visualization Products @ 1989-12-14 20:07 UTC (permalink / raw)


In article <7403@hubcap.clemson.edu> billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu writes:
>    
>   Conditional compilation would introduce an entirely new mechanism;
>   such a move must be justified in terms of benefits which cannot
>   reasonably be obtained using existing mechanisms.  The situations 
>   cited thus far do not appear to satisfy this requirement.  

As of this  reply to dave emery, you still haven't dealt with the fact 
(brought out by dave and myself) that your proposed construct (using 
a component named Y twice) is illegal.   
 
I generally respect your views, but in this case, I think the fact 
of the matter is that people are already using preprocessors.  Standardizing 
to some syntax would simply make it easier to integrate the true source code 
with smart editors, debuggers, etc. 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1989-12-14 20:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1989-12-12  0:08 conditional compilation Emery
1989-12-12 13:14 ` William Thomas Wolfe, 2847 
1989-12-14 20:07   `  Sun Visualization Products

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox