Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!think!ima!haddock!karl From: karl@haddock Newsgroups: net.lang.c Subject: Re: Orphaned Response Message-ID: <86900007@haddock> Date: Sun, 10-Aug-86 21:21:00 EDT Article-I.D.: haddock.86900007 Posted: Sun Aug 10 21:21:00 1986 Date-Received: Tue, 12-Aug-86 16:44:48 EDT References: <273@watmath.UUCP> Lines: 23 Nf-ID: #R:watmath.UUCP:273:haddock:86900007:000:830 Nf-From: haddock!karl Aug 10 21:21:00 1986 [In the expression "cond ? voidf() : voidf()",] >The void values are not thrown away! True. They are being passed to the ?: operator. >Remember that (A?B:C) is an expression *returning a value*. Yes, it is an expression (as opposed to a statement); however, some expressions have type "void" (and no value). This is (or should be) one of them. >C is giving the error because it can't determine the type. No, it's giving the error because the compiler writer overlooked a case. I'm glad X3J11 has fixed this. Btw, a case where it could be useful (and where if...else won't do) is "(cond ? voidf0() : voidf1()), intf2())" used in an integer context. I admit I have no plans to use this feature in the near future, but it's a perfectly reasonable thing to allow. Karl W. Z. Heuer (ihnp4!ima!haddock!karl), The Walking Lint