Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ecsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!mcnc!ecsvax!bet From: bet@ecsvax.UUCP (Bennett E. Todd III) Newsgroups: net.lang.c Subject: Re: Address of array Message-ID: <1294@ecsvax.UUCP> Date: Wed, 19-Mar-86 13:48:58 EST Article-I.D.: ecsvax.1294 Posted: Wed Mar 19 13:48:58 1986 Date-Received: Sat, 22-Mar-86 04:57:44 EST References: <1709@brl-smoke.ARPA> <226@dg_rtp.UUCP> Reply-To: duccpc!bet@ecsvax.UUCP (Bennett E. Todd III) Distribution: net Organization: Duke University Computation Center Lines: 33 I agree that the inconsistancy between array name semantics and structure name semantics is unfortunate. The extensions of structure assignment, parameter passing by value, and returning by value, are distasteful. Aggregates, both arrays and structures, should not be "automagically" copied around by the compiler; instances of their names as rvalues without explicit dereferencing should be converted to pointers in BOTH cases. Note that (re)establishing the notion that a structure name evaluates to a constant pointer to that structure removes the distinction between the "." and "->" operators for structure member dereference, which removes a popular source of subtle portability bugs (to and from compilers that use the old, simpler semantics). D. Gary Grady (dgary@ecsvax.UUCP) just pointed this out to me, and added that this frees up the operator "->", which we could use for longjmp:-) While I'm yapping about the big steps backward that C has made, let me add the tightening up of the semantics of "goto", making jump tables impossible. Switch statements are ideal for some things; not for everything. If you want to construct efficient finite state automata you need a jump table, without the frills forced on you by the semantics of the switch statement. Let "label" be a new reserved word, for a new data type, not convertable to any other. Let labels in code of the form ":" be constants of type label (and have the compiler do forward referencing correctly, either with multiple passes or with backpatching). Let me declare constant, initialized arrays of type label. Grrhhh. Have to write my own compiler. Grrhhh. Let's call the new language "C--". -Bennett -- Bennett Todd -- Duke Computation Center, Durham, NC 27706-7756; (919) 684-3695 UUCP: ...{decvax,seismo,philabs,ihnp4,akgua}!mcnc!ecsvax!duccpc!bet