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

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