Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!caip!brl-adm!brl-smoke!smoke!rgenter@BBN-LABS-B.ARPA From: rgenter@BBN-LABS-B.ARPA (Rick Genter) Newsgroups: net.lang.c Subject: Re: expr ? (void) : (void) Message-ID: <2679@brl-smoke.ARPA> Date: Wed, 30-Jul-86 15:06:33 EDT Article-I.D.: brl-smok.2679 Posted: Wed Jul 30 15:06:33 1986 Date-Received: Thu, 31-Jul-86 20:40:49 EDT Sender: news@brl-smoke.ARPA Lines: 49 Before we go overboard on this issue, let's take a look at a couple of points: 1) C has no "function call statement". Instead it has an "expression" statement which allows for constructs such as: printf ("Hello world\n"); ptr ++; x + 57; /* useless, but allowed */ blatz (); 2) Functions may be declared to be of type (void). For example, void blatz () { printf ("Hello world\n"); } Obviously, given 1) and 2), certain exceptions relating to the use of values of type (void) have been implemented. Yes, you can not have: void x (); int y; y = x (); since you are really trying to "use" a (void) value. However, I claim that it should be as legal to say: z ? x () : y (); as it is to say: if ( z ) x (); else y (); when both x and y return (void), given that C *already knows how to throw away the value of a (void)*. -------- Rick Genter BBN Laboratories Inc. (617) 497-3848 10 Moulton St. 6/512 rgenter@labs-b.bbn.COM (Internet new) Cambridge, MA 02238 rgenter@bbn-labs-b.ARPA (Internet old) linus!rgenter%BBN-LABS-B.ARPA (UUCP) Yow! Now I get to think about all the BAD THINGS I did to a BOWLING BALL when I was in JUNIOR HIGH SCHOOL!