Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.6.2.17 $; site ea.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!inuxc!pur-ee!uiucdcs!ea!mwm From: mwm@ea.UUCP Newsgroups: net.lang.c Subject: Re: Must a NULL pointer be a 0 bit patte Message-ID: <5700025@ea.UUCP> Date: Sun, 28-Oct-84 01:15:00 EST Article-I.D.: ea.5700025 Posted: Sun Oct 28 01:15:00 1984 Date-Received: Thu, 1-Nov-84 03:37:57 EST References: <529@wjh12.UUCP> Lines: 41 Nf-ID: #R:wjh12:-52900:ea:5700025:000:1284 Nf-From: ea!mwm Oct 27 19:15:00 1984 /***** ea:net.lang.c / utzoo!henry / 11:22 am Oct 23, 1984 */ As I understand it, nobody is claiming that the "first element" rule is good; all they are claiming is that it's simple and does not have adverse consequences elsewhere. Apparently the various alternatives all have serious problems of one kind or another. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry /* ---------- */ Was one of the alternatives something similar to the ALGOLW "record constant" facility? In C, this would translate to: (struct gezornin) {"a", 10, 2.3, 'x'} being considered a constant. Thus, you can do union initialization as so: struct gort { int type ; union info { struct gfloat { float gfx, gfy } ; struct gint { long gix, giy } ; string *name ; } ; } sample[] = { {T_FLOAT, (struct glfoat) { 3.4, 5.7 } } , {T_INT, (struct gint) { 243, 56 } } , {T_STRING, (char *) "this is a test" } } ; In other words, add a facility to allow structure constants (useful in *lots* of places), and then require all union initializations to have an explicit cast. The union initializations won't break any existing code (nobody has them now, right? :-), and the "struct constants" shouldn't break any code. Comments?