Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83 (MC840302); site boring.UUCP
Path: utzoo!watmath!clyde!cbosgd!ihnp4!mhuxn!mhuxj!mhuxr!ulysses!allegra!mit-eddie!genrad!teddy!panda!talcott!harvard!seismo!mcvax!boring!guido
From: guido@boring.UUCP
Newsgroups: net.lang.c
Subject: Re: Shared initial struct elements... history provides an answer?
Message-ID: <6284@boring.UUCP>
Date: Tue, 15-Jan-85 09:54:08 EST
Article-I.D.: boring.6284
Posted: Tue Jan 15 09:54:08 1985
Date-Received: Wed, 16-Jan-85 21:29:33 EST
References: <10885@watmath.UUCP>
Reply-To: guido@mcvax.UUCP (Guido van Rossum)
Organization: "Stamp Out BASIC" Committee, CWI, Amsterdam
Lines: 23
Summary: Apparently-To: rnews@mcvax.LOCAL

(Re: allowing 'partially qualified references' when a structure element
is unnamed and is itself a structure.)

This proposal doesn't solve any problem.
If we agree that the compiler may not reorder struct elements (i.e., we accept
the status quo), we can just use shared initial struct elements as we have
always done.  You can use the preprocessor to ensure that you indeed use
the same set of initial fields in all cases, instead of having to change
the language (slightly).
If the compiler is allowed to reorder elements, we can't even guarantee that
the unnamed substructure ends up in the same place in all structures where
it's used (without another special rule, that is), so it's still unsafe
to inspect the discriminant field.

The idea of parially qualified references in itself is nice, though, and
if introduced generally (using the Cobol or PL/1 rules, for instance),
might also be used for shared portions of larger structures as in the
original proposal.
But I will happily live without it (Ada doesn't have it, if that's an
argument :-).

	Guido van Rossum, "Stamp Out BASIC" Committee, CWI, Amsterdam
	guido@mcvax.UUCP